mirror of https://github.com/espruino/BangleApps
Refactor to remove the (apparently spurious) `Error: Unreachable point. logically broken.` warning during minification
parent
168a018b00
commit
d8ada3f734
|
@ -47,7 +47,7 @@ exports.cleanup = function() {
|
|||
Bangle.drawWidgets = exports.origDraw;
|
||||
delete exports.origDraw;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/** Put widgets offscreen, and allow them to be swiped
|
||||
back onscreen with a downwards swipe. Use .show to undo.
|
||||
|
@ -87,8 +87,7 @@ exports.swipeOn = function(autohide) {
|
|||
else Bangle.setLCDOverlay();
|
||||
}
|
||||
|
||||
for (var w of global.WIDGETS) {
|
||||
if (w._draw) continue; // already hidden
|
||||
for (var w of global.WIDGETS) if (!w._draw) { // already hidden
|
||||
w._draw = w.draw;
|
||||
w.draw = function() {
|
||||
g=og;
|
||||
|
@ -139,10 +138,9 @@ exports.swipeOn = function(autohide) {
|
|||
exports.hideTimeout = setTimeout(function() {
|
||||
anim(-4);
|
||||
}, exports.autohide);
|
||||
}
|
||||
};
|
||||
if (ud>0 && offset<0) anim(4, cb);
|
||||
if (ud<0 && offset>-24) anim(-4);
|
||||
|
||||
};
|
||||
Bangle.on("swipe", exports.swipeHandler);
|
||||
Bangle.drawWidgets();
|
||||
|
|
Loading…
Reference in New Issue