Ticket #8249: 8249_2.patch

File 8249_2.patch, 1.8 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/indent/plugin.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    425425                                        }
    426426                                }
    427427                        });
     428
     429                        editor.on( 'key', function( evt )
     430                        {
     431                                // Backspace at the beginning of  list item should outdent it.
     432                                if ( editor.mode == 'wysiwyg' && evt.data.keyCode == 8 )
     433                                {
     434                                        var sel = editor.getSelection(),
     435                                                range = sel.getRanges()[ 0 ],
     436                                                li;
     437
     438                                        if ( range.collapsed &&
     439                                                 ( li = range.startContainer.getAscendant( 'li', 1 ) ) &&
     440                                                 range.checkBoundaryOfElement( li, CKEDITOR.START ) )
     441                                        {
     442                                                editor.execCommand( 'outdent' );
     443                                                evt.cancel();
     444                                        }
     445                                }
     446                        });
    428447                },
    429448
    430449                requires : [ 'domiterator', 'list' ]
  • _source/core/dom/range.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    385385        function elementBoundaryEval( node )
    386386        {
    387387                // Reject any text node unless it's being bookmark
    388                 // OR it's spaces. (#3883)
    389                 return node.type != CKEDITOR.NODE_TEXT
    390                             && node.getName() in CKEDITOR.dtd.$removeEmpty
    391                             || !CKEDITOR.tools.trim( node.getText() )
    392                             || !!node.getParent().data( 'cke-bookmark' );
     388                // OR it's spaces.
     389                // Reject any element unless it's being invisible empty. (#3883)
     390                return node.type == CKEDITOR.NODE_TEXT ?
     391                           !CKEDITOR.tools.trim( node.getText() ) ||
     392                           !!node.getParent().data( 'cke-bookmark' )
     393                           : node.getName() in CKEDITOR.dtd.$removeEmpty;
    393394        }
    394395
    395396        var whitespaceEval = new CKEDITOR.dom.walker.whitespaces(),
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy