mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 22:27:55 +01:00
- Fix Uncaught Icon can no be found., line:3940
This commit is contained in:
parent
3f173ec2f1
commit
1efa24f2aa
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
mindplot.commands.RemoveFeatureFromTopicCommand = new Class({
|
mindplot.commands.RemoveFeatureFromTopicCommand = new Class({
|
||||||
Extends:mindplot.Command,
|
Extends:mindplot.Command,
|
||||||
initialize: function(topicId, featureId) {
|
initialize:function (topicId, featureId) {
|
||||||
$assert($defined(topicId), 'topicId can not be null');
|
$assert($defined(topicId), 'topicId can not be null');
|
||||||
$assert(featureId, 'iconModel can not be null');
|
$assert(featureId, 'iconModel can not be null');
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ mindplot.commands.RemoveFeatureFromTopicCommand = new Class({
|
|||||||
this._oldFeature = null;
|
this._oldFeature = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
execute: function(commandContext) {
|
execute:function (commandContext) {
|
||||||
var topic = commandContext.findTopics(this._topicId)[0];
|
var topic = commandContext.findTopics(this._topicId)[0];
|
||||||
|
|
||||||
var feature = topic.findFeatureById(this._featureId);
|
var feature = topic.findFeatureById(this._featureId);
|
||||||
@ -36,11 +36,13 @@ mindplot.commands.RemoveFeatureFromTopicCommand = new Class({
|
|||||||
this._oldFeature = feature;
|
this._oldFeature = feature;
|
||||||
},
|
},
|
||||||
|
|
||||||
undoExecute: function(commandContext) {
|
undoExecute:function (commandContext) {
|
||||||
var topic = commandContext.findTopics(this._topicId)[0];
|
var topic = commandContext.findTopics(this._topicId)[0];
|
||||||
|
|
||||||
var feature = this._oldFeature;
|
var feature = this._oldFeature;
|
||||||
topic.addFeature(feature.getType(), feature.getAttributes());
|
var newFeature = topic.addFeature(feature.getType(), feature.getAttributes());
|
||||||
|
this._featureId = newFeature.getModel().getId();
|
||||||
|
|
||||||
this._oldFeature = null;
|
this._oldFeature = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
Loading…
Reference in New Issue
Block a user