summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/rectangles/engine/scenery/undo.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/javascripts/rectangles/engine/scenery/undo.js')
-rw-r--r--public/assets/javascripts/rectangles/engine/scenery/undo.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/public/assets/javascripts/rectangles/engine/scenery/undo.js b/public/assets/javascripts/rectangles/engine/scenery/undo.js
index 3deb764..6ad9e0d 100644
--- a/public/assets/javascripts/rectangles/engine/scenery/undo.js
+++ b/public/assets/javascripts/rectangles/engine/scenery/undo.js
@@ -4,12 +4,13 @@
type: "create-scenery",
undo: function(state){
Scenery.remove(state.id)
+ Scenery.resize.hide()
// TODO: watch individual scenery object here
Minotaur.watch( app.router.editorView.settings )
},
redo: function(state){
- Scenery.deserialize([ state ])
+ var scenery = Scenery.deserialize([ state ])
Scenery.resize.show( scenery )
// TODO: watch individual scenery object here
@@ -20,9 +21,10 @@
type: "update-scenery",
undo: function(state){
var scenery = Scenery.find(state.id)
+ var wall = Walls.find( state.wall_id )
scenery.deserialize(state)
- scenery.set_wall(Walls.find( state.wall_id ))
+ scenery.set_wall({ wall: wall })
if (editor.permissions.resize) {
Scenery.resize.show(scenery)
@@ -33,13 +35,15 @@
},
redo: function(state){
var scenery = Scenery.find(state.id)
+ var wall = Walls.find( state.wall_id )
+
scenery.deserialize(state)
- scenery.set_wall(Walls.find( state.wall_id ))
+ scenery.set_wall({ wall: wall })
if (editor.permissions.resize) {
Scenery.resize.show(scenery)
- Scenery.resize.rotate_dots()
Scenery.resize.move_dots()
+ Scenery.resize.rotate_dots()
}
// TODO: watch individual scenery object here
@@ -49,13 +53,14 @@
{
type: "destroy-scenery",
undo: function(state){
- Scenery.deserialize([ state ])
+ var scenery = Scenery.deserialize([ state ])
Scenery.resize.show( scenery )
// TODO: watch individual scenery object here
Minotaur.watch( app.router.editorView.settings )
},
redo: function(state){
+ Scenery.resize.hide()
Scenery.remove(state.id)
// TODO: watch individual scenery object here