- Remove fade event on node creation.

- Node are always hidden on creation.
This commit is contained in:
Paulo Gustavo Veiga
2012-09-28 00:07:34 -03:00
parent 6b76c53663
commit e72ae37ac7
4 changed files with 17 additions and 36 deletions

View File

@@ -144,33 +144,6 @@ mindplot.model.NodeModel = new Class({
this._parent = parent;
},
canBeConnected:function (sourceModel, sourcePosition, targetTopicSize) {
$assert(sourceModel != this, 'The same node can not be parent and child if itself.');
$assert(sourcePosition, 'childPosition can not be null.');
$assert(targetTopicSize, 'targetTopicSize can not be null.');
var result = false;
// Only can be connected if the node is in the left or right.
var targetModel = this;
var targetPosition = targetModel.getPosition();
// Finally, check current node position ...
var yDistance = Math.abs(sourcePosition.y - targetPosition.y);
var gap = 35 + targetTopicSize.height / 2;
if (targetModel.getChildren().length > 0) {
gap += Math.abs(targetPosition.y - targetModel.getChildren()[0].getPosition().y);
}
if (yDistance <= gap) {
// Circular connection ?
var xDistance = (sourcePosition.x - targetPosition.x) * Math.sign(targetPosition.x);
result = xDistance > targetTopicSize.width;
}
return result;
},
_isChildNode:function (node) {
var result = false;
if (node == this) {