alarm 0.14: Order of 'back' menu item

pull/878/head
Gordon Williams 2021-11-08 10:03:33 +00:00
parent baa36bdd91
commit 4a3ef4829c
4 changed files with 10 additions and 9 deletions

View File

@ -94,8 +94,7 @@
{"name":"health.img","url":"app-icon.js","evaluate":true},
{"name":"health.boot.js","url":"boot.js"},
{"name":"health","url":"lib.js"}
],
"sortorder": -2
]
},
{
"id": "launch",
@ -142,13 +141,14 @@
{"name":"about.app.js","url":"app-bangle1.js","supports": ["BANGLEJS"]},
{"name":"about.app.js","url":"app-bangle2.js","supports": ["BANGLEJS2"]},
{"name":"about.img","url":"app-icon.js","evaluate":true}
]
],
"sortorder": -4
},
{
"id": "alarm",
"name": "Default Alarm & Timer",
"shortName": "Alarms",
"version": "0.13",
"version": "0.14",
"description": "Set and respond to alarms and timers",
"icon": "app.png",
"tags": "tool,alarm,widget",

View File

@ -12,3 +12,4 @@
0.12: Fix widget for bangle 2, now uses theme
Widgets now shown on Alarm screen
0.13: Alarm widget state now updates when setting/resetting an alarm
0.14: Order of 'back' menu item

View File

@ -33,6 +33,7 @@ function getCurrentHr() {
function showMainMenu() {
const menu = {
'': { 'title': 'Alarm/Timer' },
'< Back' : ()=>{load();},
'New Alarm': ()=>editAlarm(-1),
'New Timer': ()=>editTimer(-1)
};
@ -48,7 +49,7 @@ function showMainMenu() {
else editAlarm(idx);
};
});
menu['< Back'] = ()=>{load();};
if (WIDGETS["alarm"]) WIDGETS["alarm"].reload();
return E.showMenu(menu);
}
@ -70,6 +71,7 @@ function editAlarm(alarmIndex) {
}
const menu = {
'': { 'title': 'Alarm' },
'< Back' : showMainMenu,
'Hours': {
value: hrs,
onchange: function(v){if (v<0)v=23;if (v>23)v=0;hrs=v;this.value=v;} // no arrow fn -> preserve 'this'
@ -119,7 +121,6 @@ function editAlarm(alarmIndex) {
showMainMenu();
};
}
menu['< Back'] = showMainMenu;
return E.showMenu(menu);
}
@ -174,7 +175,6 @@ function editTimer(alarmIndex) {
showMainMenu();
};
}
menu['< Back'] = showMainMenu;
return E.showMenu(menu);
}

View File

@ -29,8 +29,8 @@ if (DEVICE=="BANGLEJS") {
} else if (DEVICE=="BANGLEJS2") {
var OUTFILE = path.join(ROOTDIR, '../Espruino/libs/banglejs/banglejs2_storage_default.c');
var APPS = [ // IDs of apps to install
"boot","launch","antonclk","setting","health",
"about","alarm","widlock","widbat","widbt","widid"
"boot","launch","antonclk","setting",
"about","alarm","health","widlock","widbat","widbt","widid"
];
} else {
console.log("USAGE:");