Ticket #5530: 5530_4.patch
File 5530_4.patch, 2.8 KB (added by , 15 years ago) |
---|
-
_source/plugins/pagebreak/plugin.js
84 84 85 85 var ranges = editor.getSelection().getRanges(); 86 86 87 editor.fire( 'saveSnapshot' ); 88 87 89 for ( var range, i = 0 ; i < ranges.length ; i++ ) 88 90 { 89 91 range = ranges[ i ]; … … 99 101 range.select(); 100 102 } 101 103 } 104 105 editor.fire( 'saveSnapshot' ); 102 106 } 103 107 }; -
_source/plugins/wysiwygarea/plugin.js
191 191 && blockLimit.getName() == 'body' 192 192 && !path.block ) 193 193 { 194 editor.fire( 'updateSnapshot' ); 194 195 restoreDirty( editor ); 195 196 CKEDITOR.env.ie && restoreSelection( selection ); 196 197 … … 245 246 246 247 if ( walker.previous() ) 247 248 { 249 editor.fire( 'updateSnapshot' ); 248 250 restoreDirty( editor ); 249 251 CKEDITOR.env.ie && restoreSelection( selection ); 250 252 -
_source/plugins/undo/plugin.js
114 114 // Create the first image. 115 115 editor.fire( 'saveSnapshot' ); 116 116 }; 117 118 /** 119 * Update the undo stacks with any subsequent DOM changes after this call. 120 * @name CKEDITOR.editor#updateUndo 121 * @example 122 * function() 123 * { 124 * editor.fire( 'updateSnapshot' ); 125 * ... 126 * // Ask to include subsequent (in this call stack) DOM changes to be 127 * // considered as part of the first snapshot. 128 * editor.fire( 'updateSnapshot' ); 129 * editor.document.body.append(...); 130 * ... 131 * } 132 */ 133 editor.on( 'updateSnapshot', function() 134 { 135 if ( undoManager.currentImage && new Image( editor ).equals( undoManager.currentImage ) ) 136 setTimeout( function () { undoManager.update(); }, 0 ); 137 }); 117 138 } 118 139 }); 119 140 … … 397 418 // Update current image with the actual editor 398 419 // content, since actualy content may differ from 399 420 // the original snapshot due to dom change. (#4622) 400 this.snapshots.splice( this.index, 1, ( this.currentImage = new Image( this.editor ) ) ); 401 421 this.update(); 402 422 this.fireChange(); 403 423 }, 404 424 … … 497 517 } 498 518 499 519 return false; 520 }, 521 522 /** 523 * Update the last snapshot of the undo stack with the current editor content. 524 */ 525 update : function() 526 { 527 this.snapshots.splice( this.index, 1, ( this.currentImage = new Image( this.editor ) ) ); 500 528 } 501 529 }; 502 530 })();