mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-25 15:37:56 +01:00
Fix remove icon.
This commit is contained in:
parent
c74d2de32d
commit
55db305b10
@ -108,7 +108,7 @@ mindplot.ImageIcon = new Class({
|
|||||||
|
|
||||||
remove : function() {
|
remove : function() {
|
||||||
var actionDispatcher = mindplot.ActionDispatcher.getInstance();
|
var actionDispatcher = mindplot.ActionDispatcher.getInstance();
|
||||||
actionDispatcher.removeIconFromTopic(this._topic.getModel(), this._iconModel);
|
actionDispatcher.removeIconFromTopic(this._topic.getId(), this._iconModel);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -242,21 +242,15 @@ mindplot.CommandContext = new Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
findTopics:function(topicsIds) {
|
findTopics:function(topicsIds) {
|
||||||
var designerTopics = this._designer.getModel().getTopics();
|
$assert(topicsIds, "topicsIds can not be null");
|
||||||
if (!(topicsIds instanceof Array)) {
|
if (!(topicsIds instanceof Array)) {
|
||||||
topicsIds = [topicsIds];
|
topicsIds = [topicsIds];
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = designerTopics.filter(function(topic) {
|
var designerTopics = this._designer.getModel().getTopics();
|
||||||
var found = false;
|
return designerTopics.filter(function(topic) {
|
||||||
if (topic != null) {
|
return topicsIds.contains(topic.getId());
|
||||||
var topicId = topic.getId();
|
|
||||||
found = topicsIds.contains(topicId);
|
|
||||||
}
|
|
||||||
return found;
|
|
||||||
|
|
||||||
});
|
});
|
||||||
return result;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteTopic:function(topic) {
|
deleteTopic:function(topic) {
|
||||||
|
@ -18,11 +18,11 @@
|
|||||||
|
|
||||||
mindplot.commands.RemoveIconFromTopicCommand = new Class({
|
mindplot.commands.RemoveIconFromTopicCommand = new Class({
|
||||||
Extends:mindplot.Command,
|
Extends:mindplot.Command,
|
||||||
initialize: function(topicId, iconModel)
|
initialize: function(topicIds, iconModel)
|
||||||
{
|
{
|
||||||
$assert(topicId, 'topicId can not be null');
|
$assert(topicIds, 'topicIds can not be null');
|
||||||
$assert(iconModel, 'iconId can not be null');
|
$assert(iconModel, 'iconModel can not be null');
|
||||||
this._objectsIds = topicId;
|
this._objectsIds = topicIds;
|
||||||
this._iconModel = iconModel;
|
this._iconModel = iconModel;
|
||||||
},
|
},
|
||||||
execute: function(commandContext)
|
execute: function(commandContext)
|
||||||
|
Loading…
Reference in New Issue
Block a user