Merge pull request #3491 from thyttan/setui-proposal-preview
setuichange: fix push to undefined btnWatches array as per https://forum.espruino.com/comments/17443678/master
commit
a08436b92c
|
|
@ -1 +1,3 @@
|
||||||
0.01: New App!
|
0.01: New App!
|
||||||
|
0.02: Fix case where we tried to push to Bangle.btnWatches but it wasn't
|
||||||
|
defined.
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@ Bangle.setUI = (function(mode, cb) {
|
||||||
Bangle.swipeHandler = options.swipe;
|
Bangle.swipeHandler = options.swipe;
|
||||||
Bangle.on("swipe", Bangle.swipeHandler);
|
Bangle.on("swipe", Bangle.swipeHandler);
|
||||||
}
|
}
|
||||||
|
if ((options.btn || options.btnRelease) && !Bangle.btnWatches) Bangle.btnWatches = [];
|
||||||
if (options.btn) Bangle.btnWatches.push(setWatch(options.btn.bind(options), BTN1, {repeat:1,edge:"rising"}))
|
if (options.btn) Bangle.btnWatches.push(setWatch(options.btn.bind(options), BTN1, {repeat:1,edge:"rising"}))
|
||||||
if (options.btnRelease) Bangle.btnWatches.push(setWatch(options.btnRelease.bind(options), BTN1, {repeat:1,edge:"falling"}))
|
if (options.btnRelease) Bangle.btnWatches.push(setWatch(options.btnRelease.bind(options), BTN1, {repeat:1,edge:"falling"}))
|
||||||
if (options.remove) // handler for removing the UI (intervals/etc)
|
if (options.remove) // handler for removing the UI (intervals/etc)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{ "id": "setuichange",
|
{ "id": "setuichange",
|
||||||
"name": "SetUI Proposals preview",
|
"name": "SetUI Proposals preview",
|
||||||
"version":"0.01",
|
"version":"0.02",
|
||||||
"description": "Try out potential future changes to `Bangle.setUI`. Makes hardware button interaction snappier. Makes it possible to set custom event handlers on any type/mode, not just `\"custom\"`. Please provide feedback - see `Read more...` below.",
|
"description": "Try out potential future changes to `Bangle.setUI`. Makes hardware button interaction snappier. Makes it possible to set custom event handlers on any type/mode, not just `\"custom\"`. Please provide feedback - see `Read more...` below.",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"tags": "",
|
"tags": "",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue