Permalink
Browse files

fixed bug with undo/redo and drop here box

  • Loading branch information...
1 parent a957862 commit a56affda526e07d321bd8ee1bed57cb228045a54 @Gabino3 Gabino3 committed Jul 17, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 js/geocamMaps.js
View
@@ -286,7 +286,7 @@ GeocamResponderMaps.DropHere = Ember.View.create({
alias = GeocamResponderMaps.MapSets.get('childViews').objectAt(GeocamResponderMaps.MapSets.content.indexOf(obj)).get('alias');
lastAlias = GeocamResponderMaps.MapSets.get('childViews').objectAt(GeocamResponderMaps.MapSets.content.indexOf(obj)).get('lastAlias');
checked = GeocamResponderMaps.MapSets.get('childViews').objectAt(GeocamResponderMaps.MapSets.content.indexOf(obj)).get('isChecked');
- GeocamResponderMaps.LibController.addToUndoStack('m'+indexTo+'-'+indexFrom, '');
+ GeocamResponderMaps.LibController.addToUndoStack('m'+(indexTo-1)+'-'+indexFrom, '');
}
else{
obj = GeocamResponderMaps.MapSetsLib.content.objectAt(indexFrom);
@@ -395,7 +395,7 @@ GeocamResponderMaps.LibController = Em.ArrayController.create({
this.undoStackIndex++;
this.undoStack = this.undoStack.slice(0, this.undoStackIndex);
this.undoStack.pushObject(Em.A([action, obj]));
- console.log('stack: '+this.undoStack+' index'+this.undoStackIndex);
+ //console.log('stack: '+this.undoStack+' index'+this.undoStackIndex);
},
undo: function(){
@@ -411,7 +411,7 @@ GeocamResponderMaps.LibController = Em.ArrayController.create({
this.undoStack.insertAt(this.undoStackIndex, this.inverse(action));
this.undoStackIndex--;
this.doAction(action);
- console.log('stack: '+this.undoStack+' index'+this.undoStackIndex);
+ //console.log('stack: '+this.undoStack+' index'+this.undoStackIndex);
}
},
@@ -426,7 +426,7 @@ GeocamResponderMaps.LibController = Em.ArrayController.create({
this.undoStack.removeAt(this.undoStackIndex);
this.undoStack.insertAt(this.undoStackIndex, this.inverse(action));
this.doAction(action);
- console.log('stack: '+this.undoStack+' index'+this.undoStackIndex);
+ //console.log('stack: '+this.undoStack+' index'+this.undoStackIndex);
}

0 comments on commit a56affd

Please sign in to comment.