Ticket #3662: 3662_3.patch
File 3662_3.patch, 1.7 KB (added by , 15 years ago) |
---|
-
_source/plugins/undo/plugin.js
107 107 label : editor.lang.redo, 108 108 command : 'redo' 109 109 }); 110 111 editor.resetUndo = function() 112 { 113 // Reset the undo stack. 114 undoManager.reset(); 115 116 // Create the first image. 117 editor.fire( 'saveSnapshot' ); 118 } 110 119 } 111 120 }); 112 121 … … 166 175 */ 167 176 function UndoManager( editor ) 168 177 { 169 this.typesCount = 0;170 this.modifiersCount = 0;171 172 178 this.editor = editor; 173 179 174 /** 175 * Stack for all the undo and redo snapshots, they're always created/removed 176 * in consistency. 177 */ 178 this.snapshots = []; 179 180 /** 181 * Current snapshot history index. 182 */ 183 this.index = -1; 184 185 this.limit = editor.config.undoStackSize; 186 187 /** 188 * Remember last pressed key. 189 */ 190 this.lastKeystroke = 0; 180 // Reset the undo stack. 181 this.reset(); 191 182 } 192 183 193 184 UndoManager.prototype = … … 288 279 this.typing = true; 289 280 }, 290 281 282 reset : function() // Reset the undo stack. 283 { 284 /** 285 * Remember last pressed key. 286 */ 287 this.lastKeystroke = 0; 288 289 /** 290 * Stack for all the undo and redo snapshots, they're always created/removed 291 * in consistency. 292 */ 293 this.snapshots = []; 294 295 /** 296 * Current snapshot history index. 297 */ 298 this.index = -1; 299 300 this.limit = this.editor.config.undoStackSize; 301 302 this.currentImage = null; 303 304 this.hasUndo = false; 305 this.tasRedo = false; 306 307 this.resetType(); 308 }, 309 291 310 /** 292 311 * Reset all states about typing. 293 312 * @see UndoManager.type