2017-05-01 12 views
0

Chrome 58でBold、Italicのような機能が一部更新された後&下線が機能しなくなりました。デバッグ時に、私はexecCommand( 'strikethrough')が選択されたテキストに印をつけていないことを発見しました。Yii 1.x imperavi redactor execCommand( 'strikethrough')が機能しない

formatMultiple: function(tag) 
      { 
       this.inline.formatConvert(tag); 

       this.selection.save(); 
       document.execCommand('strikethrough'); //HERE, IT IS NOT STRIKING THE TEXT 

       this.$editor.find('strike').each($.proxy(function(i,s) 
       { 
        var $el = $(s); 

        this.inline.formatRemoveSameChildren($el, tag); 

        var $span; 
        if (this.inline.type) 
        { 
         $span = $('<span>').attr('data-redactor-tag', tag).attr('data-verified', 'redactor'); 
         $span = this.inline.setFormat($span); 
        } 
        else 
        { 
         $span = $('<' + tag + '>').attr('data-redactor-tag', tag).attr('data-verified', 'redactor'); 
        } 

        $el.replaceWith($span.html($el.contents())); 

        if (tag == 'span') 
        { 
         var $parent = $span.parent(); 
         if ($parent && $parent[0].tagName == 'SPAN' && this.inline.type == 'style') 
         { 
          var arr = this.inline.value.split(';'); 

          for (var z = 0; z < arr.length; z++) 
          { 
           if (arr[z] === '') return; 
           var style = arr[z].split(':'); 
           $parent.css(style[0], ''); 

           if (this.utils.removeEmptyAttr($parent, 'style')) 
           { 
            $parent.replaceWith($parent.contents()); 
           } 

          } 

         } 
        } 

       }, this)); 

       // clear text decoration 
       if (tag != 'span') 
       { 
        this.$editor.find(this.opts.inlineTags.join(', ')).each($.proxy(function(i,s) 
        { 
         var $el = $(s); 
         var property = $el.css('text-decoration'); 
         if (property == 'line-through') 
         { 
          $el.css('text-decoration', ''); 
          this.utils.removeEmptyAttr($el, 'style'); 
         } 
        }, this)); 
       } 

       if (tag != 'del') 
       { 
        var _this = this; 
        this.$editor.find('inline').each(function(i,s) 
        { 
         _this.utils.replaceToTag(s, 'del'); 
        }); 
       } 

       this.selection.restore(); 
       this.code.sync(); 

      }, 

私はdocument.execCommand( 'strikethrough')でフィドルを作成してテストしました。ブラウザのコンソールでも動作します。何が変わったのだろうか?

答えて

関連する問題