Ticket #8222: 8222_2.patch
File 8222_2.patch, 3.3 KB (added by , 12 years ago) |
---|
-
_source/plugins/wysiwygarea/plugin.js
398 398 && !pathBlock.is( 'pre' ) 399 399 && !pathBlock.getBogus() ) 400 400 { 401 editor.fire( 'updateSnapshot' );402 restoreDirty( editor );403 401 pathBlock.appendBogus(); 404 402 } 405 403 } … … 412 410 && blockLimit.getName() == 'body' 413 411 && !path.block ) 414 412 { 415 editor.fire( 'updateSnapshot' );416 restoreDirty( editor );417 CKEDITOR.env.ie && restoreSelection( selection );418 419 413 var fixedBlock = range.fixBlock( true, 420 414 editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p' ); 421 415 … … 464 458 var testPath = new CKEDITOR.dom.elementPath( testRange.startContainer ); 465 459 if ( !testPath.blockLimit.is( 'body') ) 466 460 { 467 editor.fire( 'updateSnapshot' );468 restoreDirty( editor );469 CKEDITOR.env.ie && restoreSelection( selection );470 471 461 var paddingBlock; 472 462 if ( enterMode != CKEDITOR.ENTER_BR ) 473 463 paddingBlock = body.append( editor.document.createElement( enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' ) ); … … 1125 1115 editor.on( 'insertElement', onInsert( doInsertElement ), null, null, 20 ); 1126 1116 editor.on( 'insertText', onInsert( doInsertText ), null, null, 20 ); 1127 1117 // 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 var sel = editor.getSelection(); 1121 // Do it only when selection is not locked. (#8222) 1122 if ( sel && !sel.isLocked ) 1123 { 1124 var isDirty = editor.checkDirty(); 1125 onSelectionChangeFixBody.apply( this, arguments ); 1126 editor.fire( 'updateSnapshot' ); 1127 !isDirty && editor.resetDirty(); 1128 } 1129 }, null, null, 1 ); 1129 1130 }); 1130 1131 1131 1132 var titleBackup; -
_source/plugins/undo/plugin.js
116 116 }; 117 117 118 118 /** 119 * Update the undo stacks with any subsequent DOM changes after this call.119 * Amend the top of undo stack (last undo image) with the current DOM changes. 120 120 * @name CKEDITOR.editor#updateUndo 121 121 * @example 122 122 * function() 123 123 * { 124 * editor.fire( 'updateSnapshot' ); 124 * editor.fire( 'saveSnapshot' ); 125 * editor.document.body.append(...); 126 * // Make new changes following the last undo snapshot part of it. 127 * editor.fire( 'updateSnapshot' ); 125 128 * ... 126 * // Ask to include subsequent (in this call stack) DOM changes to be127 * // considered as part of the first snapshot.128 * editor.fire( 'updateSnapshot' );129 * editor.document.body.append(...);130 * ...131 129 * } 132 130 */ 133 131 editor.on( 'updateSnapshot', function() 134 132 { 135 if ( undoManager.currentImage &&new Image( editor ).equals( undoManager.currentImage ) )136 setTimeout( function() { undoManager.update(); }, 0);133 if ( !new Image( editor ).equals( undoManager.currentImage ) ) 134 undoManager.update(); 137 135 }); 138 136 } 139 137 });