Skip to content

Commit 0fff696

Browse files
committed
Perform reload() on movenode()
When a topic is moved in the `TreePanel`, the topic (and any of its descendants') `webPath` and `path` values will have changed. As such, the `TreePanel` needs to be `reload()`ed so that those are refreshed. Otherwise, if they are selected, they will go to a no-longer-valid location. This is only done if the entire page is not reloaded (see e6a33fa) as, in that case, the `TreePanel` will be reloaded as part of the page load instead.
1 parent e6a33fa commit 0fff696

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

OnTopic.Editor.AspNetCore/Areas/Editor/Views/Shared/_TreeViewScript.cshtml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@
104104
location.href = location.href.replace(oldParent.attributes.webPath, newParent.attributes.webPath);
105105
}
106106
107+
//Otherwise, refresh the tree to ensure the new webPaths are reflected
108+
else {
109+
currentPosition = currentTopic.indexOf(':', 5);
110+
tree.getRootNode().reload();
111+
}
112+
107113
});
108114
109115
}

0 commit comments

Comments
 (0)