Skip to content

Commit

Permalink
fix order of copied widget in group list (#626)
Browse files Browse the repository at this point in the history
  • Loading branch information
HiroyasuNishiyama authored Oct 23, 2020
1 parent 50829bf commit efc9f29
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions nodes/ui_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2997,6 +2997,7 @@
}
return 0
});
var updateList = {};
for (var i=0; i<pendingAdd.length; i++) {
var node = pendingAdd[i];
if (node.type === "ui_tab") {
Expand All @@ -3023,13 +3024,22 @@
}
if (groupLists[node.group]) {
groupLists[node.group].editableList('addItem',node)
if (node.order >= 0) {
updateList[node.group] = true;
}
}
else {
refreshOrphanedWidgets();
}
}
}
}
Object.keys(updateList).forEach(function (group) {
var list = groupLists[group];
if (list) {
list.editableList("sort", function(a,b){return a.order-b.order;});
}
});
pendingAdd = [];
}

Expand Down

0 comments on commit efc9f29

Please sign in to comment.