Fix several issues.

This commit is contained in:
Paulo Veiga
2011-09-09 21:53:41 -03:00
parent 2a4d96151b
commit d84384364c
15 changed files with 124 additions and 155 deletions

View File

@@ -190,6 +190,16 @@ mindplot.model.INodeModel = new Class({
return this.getParent() != null;
},
appendChild : function(node) {
throw "Unsupported operation";
},
connectTo : function(parent) {
$assert(parent, "parent can not be null");
var mindmap = this.getMindmap();
mindmap.connect(parent, this);
},
getPropertiesKeys : function() {
throw "Unsupported operation";
@@ -268,7 +278,10 @@ mindplot.model.INodeModel = new Class({
},
inspect : function() {
return '(type:' + this.getType() + ' , id: ' + this.getId() + ')';
return '{ type: ' + this.getType() +
' , id: ' + this.getId() +
' , text: ' + this.getText() +
' }';
},
copyTo : function(target) {
@@ -276,7 +289,7 @@ mindplot.model.INodeModel = new Class({
var keys = source.getPropertiesKeys();
keys.forEach(function(key) {
var value = source.getProperty(key);
target.putProperty(value);
target.putProperty(key, value);
});
return target;
}