We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2888a08 commit 8ee0357Copy full SHA for 8ee0357
src/Modules/SimplCommerce.Module.Cms/wwwroot/admin/menu/menu-form.js
@@ -87,10 +87,13 @@
87
88
function arrayToTree(arr) {
89
var map = {}, node, roots = [];
90
+ // use map to look-up the parents
91
+ for (var i = 0; i < arr.length; i += 1) {
92
+ map[arr[i].id] = i;
93
+ }
94
+
95
for (var i = 0; i < arr.length; i += 1) {
96
node = arr[i];
- node.children = [];
- map[node.id] = i; // use map to look-up the parents
97
if (node.parentId) {
98
arr[map[node.parentId]].children.push(node);
99
} else {
0 commit comments