Ticket #8222: 8222.patch

File 8222.patch, 2.0 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    398398                                        && !pathBlock.is( 'pre' )
    399399                                        && !pathBlock.getBogus() )
    400400                        {
    401                                 editor.fire( 'updateSnapshot' );
    402                                 restoreDirty( editor );
    403401                                pathBlock.appendBogus();
    404402                        }
    405403                }
     
    412410                                && blockLimit.getName() == 'body'
    413411                                && !path.block )
    414412                {
    415                         editor.fire( 'updateSnapshot' );
    416                         restoreDirty( editor );
    417                         CKEDITOR.env.ie && restoreSelection( selection );
    418 
    419413                        var fixedBlock = range.fixBlock( true,
    420414                                        editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p'  );
    421415
     
    464458                var testPath = new CKEDITOR.dom.elementPath( testRange.startContainer );
    465459                if ( !testPath.blockLimit.is( 'body') )
    466460                {
    467                         editor.fire( 'updateSnapshot' );
    468                         restoreDirty( editor );
    469                         CKEDITOR.env.ie && restoreSelection( selection );
    470 
    471461                        var paddingBlock;
    472462                        if ( enterMode != CKEDITOR.ENTER_BR )
    473463                                paddingBlock = body.append( editor.document.createElement( enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' ) );
     
    11251115                                        editor.on( 'insertElement', onInsert( doInsertElement ), null, null, 20 );
    11261116                                        editor.on( 'insertText', onInsert( doInsertText ), null, null, 20 );
    11271117                                        // Auto fixing on some document structure weakness to enhance usabilities. (#3190 and #3189)
    1128                                         editor.on( 'selectionChange', onSelectionChangeFixBody, null, null, 1 );
     1118                                        editor.on( 'selectionChange', function()
     1119                                        {
     1120                                                editor.fire( 'updateSnapshot' );
     1121                                                var sel = editor.getSelection();
     1122                                                // Do it only when selection is not locked. (#8222)
     1123                                                if ( sel && !sel.isLocked )
     1124                                                {
     1125                                                        var isDirty = editor.checkDirty();
     1126                                                        onSelectionChangeFixBody.apply( this, arguments );
     1127                                                        !isDirty && editor.resetDirty();
     1128                                                }
     1129                                        }, null, null, 1 );
    11291130                                });
    11301131
    11311132                        var titleBackup;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy