diff --git a/mindplot/src/main/javascript/ImageIcon.js b/mindplot/src/main/javascript/ImageIcon.js index 908244de..a07d2590 100644 --- a/mindplot/src/main/javascript/ImageIcon.js +++ b/mindplot/src/main/javascript/ImageIcon.js @@ -108,7 +108,7 @@ mindplot.ImageIcon = new Class({ remove : function() { var actionDispatcher = mindplot.ActionDispatcher.getInstance(); - actionDispatcher.removeIconFromTopic(this._topic.getModel(), this._iconModel); + actionDispatcher.removeIconFromTopic(this._topic.getId(), this._iconModel); } }); diff --git a/mindplot/src/main/javascript/LocalActionDispatcher.js b/mindplot/src/main/javascript/LocalActionDispatcher.js index dcf916aa..a894b1b6 100644 --- a/mindplot/src/main/javascript/LocalActionDispatcher.js +++ b/mindplot/src/main/javascript/LocalActionDispatcher.js @@ -242,21 +242,15 @@ mindplot.CommandContext = new Class({ }, findTopics:function(topicsIds) { - var designerTopics = this._designer.getModel().getTopics(); + $assert(topicsIds, "topicsIds can not be null"); if (!(topicsIds instanceof Array)) { topicsIds = [topicsIds]; } - var result = designerTopics.filter(function(topic) { - var found = false; - if (topic != null) { - var topicId = topic.getId(); - found = topicsIds.contains(topicId); - } - return found; - + var designerTopics = this._designer.getModel().getTopics(); + return designerTopics.filter(function(topic) { + return topicsIds.contains(topic.getId()); }); - return result; }, deleteTopic:function(topic) { diff --git a/mindplot/src/main/javascript/commands/RemoveIconFromTopicCommand.js b/mindplot/src/main/javascript/commands/RemoveIconFromTopicCommand.js index bd8825d4..adca6c33 100644 --- a/mindplot/src/main/javascript/commands/RemoveIconFromTopicCommand.js +++ b/mindplot/src/main/javascript/commands/RemoveIconFromTopicCommand.js @@ -18,11 +18,11 @@ mindplot.commands.RemoveIconFromTopicCommand = new Class({ Extends:mindplot.Command, - initialize: function(topicId, iconModel) + initialize: function(topicIds, iconModel) { - $assert(topicId, 'topicId can not be null'); - $assert(iconModel, 'iconId can not be null'); - this._objectsIds = topicId; + $assert(topicIds, 'topicIds can not be null'); + $assert(iconModel, 'iconModel can not be null'); + this._objectsIds = topicIds; this._iconModel = iconModel; }, execute: function(commandContext)