Ticket #3662: 3662.patch
File 3662.patch, 1.6 KB (added by , 15 years ago) |
---|
-
_source/plugins/undo/plugin.js
46 46 canUndo : false 47 47 }); 48 48 49 editor.on( 'resetUndoHistory', function() 50 { 51 // Reset the undo stack. 52 undoManager.reset(); 53 54 // Create the first image. 55 editor.fire( 'saveSnapshot' ); 56 }); 57 49 58 undoManager.onChange = function() 50 59 { 51 60 undoCommand.setState( undoManager.undoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED ); … … 166 175 */ 167 176 function UndoManager( editor ) 168 177 { 169 this.typesCount = 0;170 171 178 this.editor = editor; 172 179 173 /** 174 * Stack for all the undo and redo snapshots, they're always created/removed 175 * in consistency. 176 */ 177 this.snapshots = []; 178 179 /** 180 * Current snapshot history index. 181 */ 182 this.index = -1; 183 184 this.limit = editor.config.undoStackSize; 180 this.reset(); 185 181 } 186 182 187 183 UndoManager.prototype = … … 278 274 return true; 279 275 }, 280 276 277 reset : function() // Reset the undo stack, 278 { 279 this.typesCount = 0; 280 281 /** 282 * Stack for all the undo and redo snapshots, they're always created/removed 283 * in consistency. 284 */ 285 this.snapshots = []; 286 287 /** 288 * Current snapshot history index. 289 */ 290 this.index = -1; 291 292 this.limit = this.editor.config.undoStackSize; 293 294 this.currentImage = null; 295 }, 296 281 297 restoreImage : function( image ) 282 298 { 283 299 this.editor.loadSnapshot( image.contents );