Keyboard actions for adding is working with the new layout...

This commit is contained in:
Paulo Veiga
2012-01-11 21:12:22 -03:00
parent d9cdcc5160
commit 51bc3e563a
8 changed files with 110 additions and 166 deletions

View File

@@ -27,7 +27,6 @@ mindplot.Topic = new Class({
this._parent = null;
this._relationships = [];
this._isInWorkspace = false;
this._helpers = [];
this._buildShape();
// Position a topic ....
@@ -144,12 +143,6 @@ mindplot.Topic = new Class({
if ($defined(connector)) {
connector.moveToFront();
}
//Move helpers to front
this._helpers.forEach(function(helper) {
helper.moveToFront();
});
}
},
@@ -1257,11 +1250,28 @@ mindplot.Topic = new Class({
}
},
addHelper : function(helper) {
helper.addToGroup(this.get2DElement());
this._helpers.push(helper);
}
// @Todo: this don't seems to be a nice way... Order should be infered automatically ...
createChildModel : function() {
// Create a new node ...
var model = this.getModel();
var mindmap = model.getMindmap();
var childModel = mindmap.createNode(mindplot.model.INodeModel.MAIN_TOPIC_TYPE);
// Get the hights model order position ...
var children = this._getChildren();
var order = -1;
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (child.getOrder() > order) {
order = child.getOrder();
}
}
// Create a new node ...
childModel.setOrder(order + 1);
childModel.setPosition(10, 10);
return childModel;
}
});