From 4a0d70e3b388e16d8bb78d8b39728101f965913f Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 27 Sep 2012 08:12:03 -0300 Subject: [PATCH] - Minor fixes --- .../src/main/javascript/commands/DragTopicCommand.js | 11 +++++------ .../javascript/commands/GenericFunctionCommand.js | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/mindplot/src/main/javascript/commands/DragTopicCommand.js b/mindplot/src/main/javascript/commands/DragTopicCommand.js index 42ef4c9d..1f641382 100644 --- a/mindplot/src/main/javascript/commands/DragTopicCommand.js +++ b/mindplot/src/main/javascript/commands/DragTopicCommand.js @@ -18,22 +18,21 @@ mindplot.commands.DragTopicCommand = new Class({ Extends:mindplot.Command, - initialize:function (topicIds, position, order, parentTopic) { - $assert(topicIds, "topicIds must be defined"); + initialize:function (topicId, position, order, parentTopic) { + $assert(topicId, "topicId must be defined"); - this._topicsIds = topicIds; + this._topicsId = topicId; if ($defined(parentTopic)) this._parentId = parentTopic.getId(); this.parent(); this._position = position; this._order = order; - this._id = mindplot.Command._nextUUID(); }, execute:function (commandContext) { - var topic = commandContext.findTopics([this._topicsIds])[0]; + var topic = commandContext.findTopics(this._topicsId)[0]; // Save old position ... var origParentTopic = topic.getOutgoingConnectedTopic(); @@ -60,7 +59,7 @@ mindplot.commands.DragTopicCommand = new Class({ if (origParentTopic != this._parentId) { if ($defined(this._parentId)) { - var parentTopic = commandContext.findTopics([this._parentId])[0]; + var parentTopic = commandContext.findTopics(this._parentId)[0]; commandContext.connect(topic, parentTopic); } diff --git a/mindplot/src/main/javascript/commands/GenericFunctionCommand.js b/mindplot/src/main/javascript/commands/GenericFunctionCommand.js index 22742c91..9488fab0 100644 --- a/mindplot/src/main/javascript/commands/GenericFunctionCommand.js +++ b/mindplot/src/main/javascript/commands/GenericFunctionCommand.js @@ -24,14 +24,14 @@ mindplot.commands.GenericFunctionCommand = new Class({ this.parent(); this._value = value; - this._topicsIds = topicsIds; + this._topicsId = topicsIds; this._commandFunc = commandFunc; this._oldValues = []; }, execute: function(commandContext) { if (!this.applied) { - var topics = commandContext.findTopics(this._topicsIds); + var topics = commandContext.findTopics(this._topicsId); topics.each(function(topic) { var oldValue = this._commandFunc(topic, this._value); this._oldValues.push(oldValue); @@ -45,7 +45,7 @@ mindplot.commands.GenericFunctionCommand = new Class({ undoExecute: function(commandContext) { if (this.applied) { - var topics = commandContext.findTopics(this._topicsIds); + var topics = commandContext.findTopics(this._topicsId); topics.each(function(topic, index) { this._commandFunc(topic, this._oldValues[index]);