- Remove fade event on node creation.
- Node are always hidden on creation.
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user