Ticket #8321: 8321_3.patch

File 8321_3.patch, 1.9 KB (added by Garry Yao, 12 years ago)
  • _source/core/dom/element.js

     
    719719                        return false;
    720720                },
    721721
    722                 isEditable : function()
     722                /**
     723                 * Decide whether one element is able to receive cursor.
     724                 * @param {Boolean} [textCursor=true] Only consider element that could receive text child.
     725                 */
     726                isEditable : function( textCursor )
    723727                {
    724                         if ( this.isReadOnly() || !this.isVisible() )
    725                                 return false;
    726 
    727                         // Get the element name.
    728728                        var name = this.getName();
    729729
    730                         // Get the element DTD (defaults to span for unknown elements).
    731                         var dtd = !CKEDITOR.dtd.$nonEditable[ name ]
    732                                                 && ( CKEDITOR.dtd[ name ] || CKEDITOR.dtd.span );
     730                        if ( this.isReadOnly()
     731                                        || this.getComputedStyle( 'display' ) == 'none'
     732                                        || this.getComputedStyle( 'visibility' ) == 'hidden'
     733                                        || CKEDITOR.dtd.$nonEditable[ name ] )
     734                        {
     735                                return false;
     736                        }
    733737
    734                         // In the DTD # == text node.
    735                         return ( dtd && dtd['#'] );
     738                        if ( textCursor !== false )
     739                        {
     740                                // Get the element DTD (defaults to span for unknown elements).
     741                                var dtd = CKEDITOR.dtd[ name ] || CKEDITOR.dtd.span;
     742                                // In the DTD # == text node.
     743                                return ( dtd && dtd[ '#'] );
     744                        }
     745
     746                        return true;
    736747                },
    737748
    738749                isIdentical : function( otherElement )
  • _source/core/dom/range.js

     
    19251925                                var next;
    19261926
    19271927                                if ( node.type == CKEDITOR.NODE_ELEMENT
    1928                                                 && !node.isReadOnly()
    1929                                                 && node.isVisible()
     1928                                                && node.isEditable( false )
    19301929                                                && !CKEDITOR.dtd.$nonEditable[ node.getName() ] )
    19311930                                {
    19321931                                        next = node[ isMoveToEnd ? 'getLast' : 'getFirst' ]( nonWhitespaceOrBookmarkEval );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy