mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
Bangle.js: Fix back handler not removed when using E.setUI with a back button but without widgets (#2636)
This commit is contained in:
parent
18fbbe7fa3
commit
a454207e03
@ -1,4 +1,5 @@
|
||||
: Add `E.internal` as a way to access the 'hidden root' containing Espruino internal variables that previously needed `global["\xff"]`
|
||||
Bangle.js: Fix back handler not removed when using E.setUI with a back button but without widgets (#2636)
|
||||
|
||||
2v27 : nRF5x: Ensure Bluetooth notifications work correctly when two separate connections use the same handle for their characteristics
|
||||
nRF5x: Remove handlers from our handlers array when a device is disconnected
|
||||
|
||||
@ -92,13 +92,12 @@
|
||||
if (options.redraw) // handler for redrawing the UI
|
||||
Bangle.uiRedraw = options.redraw;
|
||||
if (options.back) {
|
||||
var btnWatch;
|
||||
// only add back button handler if there's no existing watch on BTN1
|
||||
if (Bangle.btnWatches===undefined)
|
||||
btnWatch = setWatch(function() {
|
||||
btnWatch = undefined;
|
||||
Bangle.btnWatches = [ setWatch(function() {
|
||||
Bangle.btnWatches = undefined; // watch doesn't repeat
|
||||
options.back();
|
||||
}, BTN3, {edge:"rising"});
|
||||
}, BTN3, {edge:"rising"}) ];
|
||||
// if we have widgets loaded *and* visible at the top, add a back widget (see #3788)
|
||||
if (global.WIDGETS && Bangle.appRect.y) {
|
||||
// add our own touch handler for touching in the left
|
||||
@ -116,7 +115,6 @@
|
||||
remove:function(noclear){
|
||||
var w = WIDGETS.back;
|
||||
if (w.area!="tl") noclear=true; // area="" is set by widget_utils.hide, so avoid drawing
|
||||
if (btnWatch) clearWatch(btnWatch);
|
||||
Bangle.removeListener("touch", touchHandler);
|
||||
if (!noclear) g.reset().clearRect({x:w.x, y:w.y, w:24,h:24});
|
||||
delete WIDGETS.back;
|
||||
|
||||
BIN
libs/js/banglejs/Bangle_setUI_F18.min.js
vendored
BIN
libs/js/banglejs/Bangle_setUI_F18.min.js
vendored
Binary file not shown.
@ -119,12 +119,11 @@
|
||||
Bangle.uiRedraw = options.redraw;
|
||||
if (options.back) {
|
||||
// only add back button handler if there's no existing watch on BTN1
|
||||
if (Bangle.btnWatches===undefined) {
|
||||
if (Bangle.btnWatches===undefined)
|
||||
Bangle.btnWatches = [ setWatch(function() {
|
||||
Bangle.btnWatches = undefined; // watch doesn't repeat
|
||||
options.back();
|
||||
}, BTN1, {edge:"rising"}) ];
|
||||
}
|
||||
// if we have widgets loaded *and* visible at the top, add a back widget (see #3788)
|
||||
if (global.WIDGETS && Bangle.appRect.y) {
|
||||
// add our own touch handler for touching in the top left
|
||||
|
||||
BIN
libs/js/banglejs/Bangle_setUI_Q3.min.js
vendored
BIN
libs/js/banglejs/Bangle_setUI_Q3.min.js
vendored
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user