From 4d3baac09d9c465823f32fc1235c144373af1c6c Mon Sep 17 00:00:00 2001 From: Paulo Veiga Date: Wed, 30 Nov 2011 00:59:36 -0300 Subject: [PATCH] - Fix actions over the central topic. --- .../src/main/javascript/commands/ChangeLinkToTopicCommand.js | 2 +- .../src/main/javascript/commands/ChangeNoteToTopicCommand.js | 4 ++-- .../src/main/javascript/commands/GenericFunctionCommand.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mindplot/src/main/javascript/commands/ChangeLinkToTopicCommand.js b/mindplot/src/main/javascript/commands/ChangeLinkToTopicCommand.js index ef259057..3578b12d 100644 --- a/mindplot/src/main/javascript/commands/ChangeLinkToTopicCommand.js +++ b/mindplot/src/main/javascript/commands/ChangeLinkToTopicCommand.js @@ -19,7 +19,7 @@ mindplot.commands.ChangeLinkToTopicCommand = new Class({ Extends:mindplot.Command, initialize: function(topicId, url) { - $assert(topicId, 'topicId can not be null'); + $assert($defined(topicId), 'topicId can not be null'); this._topicsIds = topicId; this._url = url; this._id = mindplot.Command._nextUUID(); diff --git a/mindplot/src/main/javascript/commands/ChangeNoteToTopicCommand.js b/mindplot/src/main/javascript/commands/ChangeNoteToTopicCommand.js index 6c3ad86c..117d97c7 100644 --- a/mindplot/src/main/javascript/commands/ChangeNoteToTopicCommand.js +++ b/mindplot/src/main/javascript/commands/ChangeNoteToTopicCommand.js @@ -19,14 +19,14 @@ mindplot.commands.ChangeNoteToTopicCommand = new Class({ Extends:mindplot.Command, initialize: function(topicId, text) { - $assert(topicId, 'topicId can not be null'); + $assert($defined(topicId), 'topicId can not be null'); this._topicsIds = topicId; this._text = text; this._oldtext = null; this._id = mindplot.Command._nextUUID(); }, - execute: function(commandContext) { + execute: function(commandContext) { var topic = commandContext.findTopics(this._topicsIds)[0]; if (topic.hasNote()) { var model = topic.getModel(); diff --git a/mindplot/src/main/javascript/commands/GenericFunctionCommand.js b/mindplot/src/main/javascript/commands/GenericFunctionCommand.js index b2552103..00d9f576 100644 --- a/mindplot/src/main/javascript/commands/GenericFunctionCommand.js +++ b/mindplot/src/main/javascript/commands/GenericFunctionCommand.js @@ -20,7 +20,7 @@ mindplot.commands.GenericFunctionCommand = new Class({ Extends:mindplot.Command, initialize: function(commandFunc, topicsIds,value) { $assert(commandFunc, "commandFunc must be defined"); - $assert(topicsIds, "topicsIds must be defined"); + $assert($defined(topicsIds), "topicsIds must be defined"); this._value = value; this._topicsIds = topicsIds;