Fix copy and paste issue.

This commit is contained in:
Paulo Gustavo Veiga 2013-03-03 00:51:14 -03:00
parent bf3bd5c1c7
commit 1c1fc2ca96

View File

@ -57,12 +57,20 @@ mindplot.commands.AddTopicCommand = new Class({
}, },
undoExecute:function (commandContext) { undoExecute:function (commandContext) {
// Finally, delete the topic from the workspace ... // Delete disconnected the nodes. Create a copy of the topics ...
var clonedModel = [];
this._models.each(function (model) {
clonedModel.push(model.clone());
});
// Finally, remove the nodes ...
this._models.each(function (model) { this._models.each(function (model) {
var topicId = model.getId(); var topicId = model.getId();
var topic = commandContext.findTopics(topicId)[0]; var topic = commandContext.findTopics(topicId)[0];
commandContext.deleteTopic(topic); commandContext.deleteTopic(topic);
}.bind(this)); }.bind(this));
this._models = clonedModel;
} }
}); });