diff options
author | Ananya Sen | 2012-02-27 17:39:26 -0800 |
---|---|---|
committer | Ananya Sen | 2012-02-27 17:39:26 -0800 |
commit | 2edcdd88ffc2f6ff0ea836e4da3e1fd2cb3e856f (patch) | |
tree | 18361c8889884ed9c4eb687182ac42afb0d0f13d /js/controllers | |
parent | 51ed781953bc44bba3c70938aa57b856394cbc88 (diff) | |
download | ninja-2edcdd88ffc2f6ff0ea836e4da3e1fd2cb3e856f.tar.gz |
persist undo/redo stack per html document
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/controllers')
-rwxr-xr-x | js/controllers/undo-controller.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/js/controllers/undo-controller.js b/js/controllers/undo-controller.js index 926803d3..01853593 100755 --- a/js/controllers/undo-controller.js +++ b/js/controllers/undo-controller.js | |||
@@ -71,22 +71,28 @@ exports.UndoController = Montage.create( Component, { | |||
71 | /** | 71 | /** |
72 | * Undo Queue | 72 | * Undo Queue |
73 | */ | 73 | */ |
74 | _undoQueue: { value: [] }, | 74 | _undoQueue: { value: [], writable:true }, |
75 | 75 | ||
76 | undoQueue: { | 76 | undoQueue: { |
77 | get: function() { | 77 | get: function() { |
78 | return this._undoQueue; | 78 | return this._undoQueue; |
79 | }, | ||
80 | set: function(value){ | ||
81 | this._undoQueue = value; | ||
79 | } | 82 | } |
80 | }, | 83 | }, |
81 | 84 | ||
82 | /** | 85 | /** |
83 | * Redo Queue | 86 | * Redo Queue |
84 | */ | 87 | */ |
85 | _redoQueue: { value: [], enumerable: false }, | 88 | _redoQueue: { value: [], enumerable: false, writable:true }, |
86 | 89 | ||
87 | redoQueue: { | 90 | redoQueue: { |
88 | get: function() { | 91 | get: function() { |
89 | return this._redoQueue; | 92 | return this._redoQueue; |
93 | }, | ||
94 | set: function(value){ | ||
95 | this._redoQueue = value; | ||
90 | } | 96 | } |
91 | }, | 97 | }, |
92 | 98 | ||
@@ -202,5 +208,12 @@ exports.UndoController = Montage.create( Component, { | |||
202 | this.redoQueue.splice(0, this.redoQueue.length); | 208 | this.redoQueue.splice(0, this.redoQueue.length); |
203 | //this.redoQueue = []; | 209 | //this.redoQueue = []; |
204 | } | 210 | } |
211 | }, | ||
212 | |||
213 | clearHistory:{ | ||
214 | value: function(){ | ||
215 | this.undoQueue.splice(0, this.undoQueue.length); | ||
216 | this.redoQueue.splice(0, this.redoQueue.length); | ||
217 | } | ||
205 | } | 218 | } |
206 | }); \ No newline at end of file | 219 | }); \ No newline at end of file |