- Fix feature issue on redo.

This commit is contained in:
Paulo Gustavo Veiga 2012-09-27 23:28:24 -03:00
parent 22d9f7a199
commit e5ab234d01
3 changed files with 28 additions and 23 deletions

View File

@ -1040,7 +1040,7 @@ mindplot.Topic = new Class({
// Create a connection line ... // Create a connection line ...
var outgoingLine = new mindplot.ConnectionLine(this, targetTopic); var outgoingLine = new mindplot.ConnectionLine(this, targetTopic);
outgoingLine.setVisibility(this.isVisible()); outgoingLine.setVisibility(true); // @Todo: This must be false. Check remove of all nodes and redo.
this._outgoingLine = outgoingLine; this._outgoingLine = outgoingLine;
workspace.appendChild(outgoingLine); workspace.appendChild(outgoingLine);

View File

@ -17,10 +17,22 @@
*/ */
mindplot.model.FeatureModel = new Class({ mindplot.model.FeatureModel = new Class({
initialize:function(type) { Static:{
$assert(type, 'type can not be null'); _nextUUID:function () {
if (!$defined(mindplot.model.FeatureModel._uuid)) {
mindplot.model.FeatureModel._uuid = 0;
}
mindplot.model.FeatureModel._uuid = mindplot.model.FeatureModel._uuid + 1;
console.log(mindplot.model.FeatureModel._uuid);
return mindplot.model.FeatureModel._uuid;
}
},
initialize:function (type, id) {
$assert(type, 'type can not be null');
this._id = $defined(id) ? this._id : mindplot.model.FeatureModel._nextUUID();
this._id = mindplot.model.FeatureModel._nextUUID();
this._type = type; this._type = type;
this._attributes = {}; this._attributes = {};
@ -63,12 +75,3 @@ mindplot.model.FeatureModel = new Class({
return this._type; return this._type;
} }
}); });
mindplot.model.FeatureModel._nextUUID = function() {
if (!$defined(this._uuid)) {
this._uuid = 0;
}
this._uuid = this._uuid + 1;
return this._uuid;
};

View File

@ -47,7 +47,9 @@ mindplot.model.NodeModel = new Class({
removeFeature:function (feature) { removeFeature:function (feature) {
$assert(feature, 'feature can not be null'); $assert(feature, 'feature can not be null');
this._feature.erase(feature); this._feature = this._feature.filter(function (f) {
return feature.getId() != f.getId();
});
}, },
findFeatureByType:function (type) { findFeatureByType:function (type) {