- Fix orphan relationships.

This commit is contained in:
Paulo Gustavo Veiga 2012-09-24 20:40:01 -03:00
parent be4d7d1c91
commit 8320ae0abf

View File

@ -134,15 +134,13 @@ mindplot.commands.DeleteCommand = new Class({
_collectInDepthRelationships:function (topic) { _collectInDepthRelationships:function (topic) {
var result = []; var result = [];
result.append(topic.getRelationships());
var children = topic.getChildren(); var children = topic.getChildren();
if (children.length > 0) {
var rels = children.map(function (topic) { var rels = children.map(function (topic) {
return this._collectInDepthRelationships(topic); return this._collectInDepthRelationships(topic);
}, this); }, this);
result.append(rels.flatten()); result.append(rels.flatten());
} else {
result.append(topic.getRelationships());
}
return result; return result;
} }