mirror of https://github.com/espruino/BangleApps
smpltmr: reset clkinfo to "main" timer on blur
parent
33088c6257
commit
54907714a2
|
@ -5,4 +5,5 @@
|
|||
0.05: Updated clkinfo icon.
|
||||
0.06: Ensure Timer supplies an image for clkinfo items
|
||||
0.07: Update clock_info to avoid a redraw
|
||||
0.08: Timer ClockInfo now updates once a minute
|
||||
0.08: Timer ClockInfo now updates once a minute
|
||||
0.09: Timer ClockInfo resets to timer menu when blurred
|
||||
|
|
|
@ -71,13 +71,19 @@
|
|||
]
|
||||
};
|
||||
|
||||
const restoreMainItem = function(clkinfo) {
|
||||
clkinfo.menuB = 0;
|
||||
// clock info redraws after this
|
||||
};
|
||||
|
||||
var offsets = [+5,-5];
|
||||
offsets.forEach((o, i) => {
|
||||
smpltmrItems.items = smpltmrItems.items.concat({
|
||||
name: null,
|
||||
get: () => ({ text: (o > 0 ? "+" : "") + o + " min.", img: smpltmrItems.img }),
|
||||
show: function() { },
|
||||
hide: function () { },
|
||||
hide: function() { },
|
||||
blur: restoreMainItem,
|
||||
run: function() {
|
||||
if(o > 0) increaseAlarm(o);
|
||||
else decreaseAlarm(Math.abs(o));
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id": "smpltmr",
|
||||
"name": "Simple Timer",
|
||||
"shortName": "Simple Timer",
|
||||
"version": "0.08",
|
||||
"version": "0.09",
|
||||
"description": "A very simple app to start a timer.",
|
||||
"icon": "app.png",
|
||||
"tags": "tool,alarm,timer,clkinfo",
|
||||
|
|
Loading…
Reference in New Issue