From 1c1fc2ca96d9f435a6f36253d7aa865b09c31529 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 3 Mar 2013 00:51:14 -0300 Subject: [PATCH] Fix copy and paste issue. --- .../src/main/javascript/commands/AddTopicCommand.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mindplot/src/main/javascript/commands/AddTopicCommand.js b/mindplot/src/main/javascript/commands/AddTopicCommand.js index 2ceabae8..ce20a964 100644 --- a/mindplot/src/main/javascript/commands/AddTopicCommand.js +++ b/mindplot/src/main/javascript/commands/AddTopicCommand.js @@ -57,12 +57,20 @@ mindplot.commands.AddTopicCommand = new Class({ }, 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) { var topicId = model.getId(); var topic = commandContext.findTopics(topicId)[0]; commandContext.deleteTopic(topic); }.bind(this)); + + this._models = clonedModel; } }); \ No newline at end of file