From 8320ae0abf5b1cf290367d68ab334cac1f066b2e Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 24 Sep 2012 20:40:01 -0300 Subject: [PATCH] - Fix orphan relationships. --- .../src/main/javascript/commands/DeleteCommand.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/mindplot/src/main/javascript/commands/DeleteCommand.js b/mindplot/src/main/javascript/commands/DeleteCommand.js index 9e06229e..a8110b88 100644 --- a/mindplot/src/main/javascript/commands/DeleteCommand.js +++ b/mindplot/src/main/javascript/commands/DeleteCommand.js @@ -134,15 +134,13 @@ mindplot.commands.DeleteCommand = new Class({ _collectInDepthRelationships:function (topic) { var result = []; + result.append(topic.getRelationships()); + var children = topic.getChildren(); - if (children.length > 0) { - var rels = children.map(function (topic) { - return this._collectInDepthRelationships(topic); - }, this); - result.append(rels.flatten()); - } else { - result.append(topic.getRelationships()); - } + var rels = children.map(function (topic) { + return this._collectInDepthRelationships(topic); + }, this); + result.append(rels.flatten()); return result; }