mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-12-23 11:53:48 +01:00
- Fix undo issues over features.
This commit is contained in:
parent
1efa24f2aa
commit
9ab4c4975c
@ -274,7 +274,7 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
addFeature:function (type, attributes) {
|
addFeature:function (type, attributes, featureId) {
|
||||||
var iconGroup = this.getOrBuildIconGroup();
|
var iconGroup = this.getOrBuildIconGroup();
|
||||||
this.closeEditors();
|
this.closeEditors();
|
||||||
|
|
||||||
@ -282,8 +282,12 @@ mindplot.Topic = new Class({
|
|||||||
|
|
||||||
// Update model ...
|
// Update model ...
|
||||||
var feature = model.createFeature(type, attributes);
|
var feature = model.createFeature(type, attributes);
|
||||||
|
if ($defined(featureId)) {
|
||||||
|
feature.setId(featureId);
|
||||||
|
}
|
||||||
model.addFeature(feature);
|
model.addFeature(feature);
|
||||||
|
|
||||||
|
|
||||||
var result = mindplot.TopicFeature.createIcon(this, feature, this.isReadOnly());
|
var result = mindplot.TopicFeature.createIcon(this, feature, this.isReadOnly());
|
||||||
iconGroup.addIcon(result, type == mindplot.TopicFeature.Icon.id && !this.isReadOnly());
|
iconGroup.addIcon(result, type == mindplot.TopicFeature.Icon.id && !this.isReadOnly());
|
||||||
|
|
||||||
|
@ -40,9 +40,7 @@ mindplot.commands.RemoveFeatureFromTopicCommand = new Class({
|
|||||||
var topic = commandContext.findTopics(this._topicId)[0];
|
var topic = commandContext.findTopics(this._topicId)[0];
|
||||||
|
|
||||||
var feature = this._oldFeature;
|
var feature = this._oldFeature;
|
||||||
var newFeature = topic.addFeature(feature.getType(), feature.getAttributes());
|
topic.addFeature(feature.getType(), feature.getAttributes(), this._featureId);
|
||||||
this._featureId = newFeature.getModel().getId();
|
|
||||||
|
|
||||||
this._oldFeature = null;
|
this._oldFeature = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
@ -55,6 +55,10 @@ mindplot.model.FeatureModel = new Class({
|
|||||||
return this._id;
|
return this._id;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setId : function(id) {
|
||||||
|
this._id = id;
|
||||||
|
},
|
||||||
|
|
||||||
getType:function() {
|
getType:function() {
|
||||||
return this._type;
|
return this._type;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user