mirror of https://github.com/espruino/BangleApps
wid_edit: sort widgets with same sortorder by name
(assuming Array.sort() is stable)pull/1303/head
parent
832f308fde
commit
9a8ccf0f4f
|
@ -30,6 +30,7 @@ Bangle.loadWidgets = function() {
|
|||
const W = WIDGETS;
|
||||
WIDGETS = {};
|
||||
Object.keys(W)
|
||||
.sort()
|
||||
.sort((a, b) => (0|W[b].sortorder)-(0|W[a].sortorder))
|
||||
.forEach(k => WIDGETS[k] = W[k]);
|
||||
}
|
|
@ -14,6 +14,7 @@
|
|||
let W = WIDGETS;
|
||||
global.WIDGETS = {};
|
||||
Object.keys(W)
|
||||
.sort()
|
||||
.sort((a, b) => (0|W[b].sortorder)-(0|W[a].sortorder))
|
||||
.forEach(k => {WIDGETS[k] = W[k]});
|
||||
Bangle.drawWidgets();
|
||||
|
|
Loading…
Reference in New Issue