-Fix problem on element undo...

This commit is contained in:
Paulo Gustavo Veiga 2012-07-07 18:58:42 -03:00
parent 80940b8529
commit 3a0c79a2a8
4 changed files with 241 additions and 233 deletions

View File

@ -30,16 +30,21 @@ mindplot.DesignerActionRunner = new Class({
command.execute(this._context);
this._undoManager.enqueue(command);
this.fireChangeEvent();
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout);
},
undo: function() {
this._undoManager.execUndo(this._context);
this.fireChangeEvent();
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout);
},
redo: function() {
this._undoManager.execRedo(this._context);
this.fireChangeEvent();
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout);
},
fireChangeEvent : function () {

View File

@ -207,7 +207,9 @@ mindplot.DragTopic = new Class({
},
isFreeLayoutOn: function() {
return this._isFreeLayoutEnabled;
// return this._isFreeLayoutEnabled;
// Disable free layout ...
return false;
}
});

View File

@ -231,7 +231,6 @@ mindplot.StandaloneActionDispatcher = new Class({
execute:function (command) {
this._actionRunner.execute(command);
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout);
}
});

View File

@ -84,11 +84,13 @@ mindplot.commands.DeleteCommand = new Class({
var parentTopic = parent[index];
if (parentTopic != null) {
commandContext.connect(topic, parentTopic);
topic.setOnFocus();
}
}.bind(this)
);
this._deletedRelModel.forEach(function (model) {
commandContext.addRelationship(model);
}.bind(this));