More fixes.

This commit is contained in:
Paulo Veiga
2011-09-10 01:17:48 -03:00
parent 1abda3914a
commit c1e0d52ff5
10 changed files with 133 additions and 73 deletions

View File

@@ -23,6 +23,27 @@ mindplot.BrixActionDispatcher = new Class({
this._commandContext = commandContext;
},
dragTopic: function(topicId, position, order, parentTopic) {
var framework = this._getFramework();
var node = framework.getTopic(topicId);
// Set node order ...
if (order != null) {
node.setOrder(order);
} else if (position != null) {
// Set position ...
node.setPosition(position);
} else {
$assert("Illegal commnad state exception.");
}
// Finally, connect node ...
if ($defined(this._parentId)) {
var parentNode = topic.findTopics([this._parentId])[0];
node.disconnect();
node.connect(parentNode);
}
},
changeTextToTopic : function(topicsIds, text) {
var framework = this._getFramework();
var topicId;
@@ -127,7 +148,7 @@ mindplot.BrixActionDispatcher = new Class({
var topicId = topicsIds[0];
var topic = framework.getTopic(topicId);
$assert(topic, "Could not find topic with id:" + topicId);
mindmap.disconnect(topic);
topic.deleteNode();
}
});