mirror of https://github.com/espruino/BangleApps
wid_edit: restore alphabetical sort
parent
ba995ddf4e
commit
2023138295
|
@ -4,3 +4,4 @@
|
|||
Allow changing widgets into all areas, including bottom widget bar
|
||||
0.03: Fix editing widgets whose draw method takes the widget
|
||||
0.04: Remove double-sort
|
||||
0.05: Restore alphabetical sort
|
||||
|
|
|
@ -14,6 +14,7 @@ Bangle.loadWidgets = (o => ()=>{
|
|||
const W = global.WIDGETS;
|
||||
global.WIDGETS = {};
|
||||
Object.keys(W)
|
||||
.sort() // sort alphabetically. the next sort is stable and preserves this if sortorder matches
|
||||
.sort((a, b) => (0|W[b].sortorder)-(0|W[a].sortorder))
|
||||
.forEach(k => global.WIDGETS[k] = W[k]);
|
||||
})(Bangle.loadWidgets);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"id": "wid_edit",
|
||||
"version": "0.04",
|
||||
"version": "0.05",
|
||||
"name": "Widget Editor",
|
||||
"icon": "icon.png",
|
||||
"description": "Customize widget locations",
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
let W = global.WIDGETS;
|
||||
global.WIDGETS = {};
|
||||
Object.keys(W)
|
||||
.sort()
|
||||
.sort() // see comment in boot.js
|
||||
.sort((a, b) => (0|W[b].sortorder)-(0|W[a].sortorder))
|
||||
.forEach(k => {global.WIDGETS[k] = W[k];});
|
||||
Bangle.drawWidgets();
|
||||
|
|
Loading…
Reference in New Issue