mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
Bangle.js2: Fix issue using touch handler with Bangle.setUI({mode:"updown",...}) (fix #2648)
This commit is contained in:
parent
f3b5e0dbcd
commit
8b2e5a57b6
@ -6,6 +6,7 @@
|
||||
Bangle.js2: Adjust accelerometer axes for HRM algorithm to more closely match the datasheet
|
||||
nRF52: Add NRF/BluetoothRemoteGATTServer.updateConnection for setting the phy
|
||||
Bangle.js2: Add Bangle.setOptions({hrmStaticSampleTime})
|
||||
Bangle.js2: Fix issue using touch handler with Bangle.setUI({mode:"updown",...}) (fix #2648)
|
||||
|
||||
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
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
if (!mode) throw new Error("Missing mode in setUI({...})");
|
||||
}
|
||||
var hadBackWidget = false;
|
||||
if (global.WIDGETS && WIDGETS.back) {
|
||||
if (global.WIDGETS && WIDGETS.back) {
|
||||
hadBackWidget = true; // if we had a back widget already, don't redraw at the end
|
||||
WIDGETS.back.remove(options.back); // only redraw when removing if we don't have options.back
|
||||
}
|
||||
@ -26,6 +26,10 @@
|
||||
Bangle.removeListener("touch", Bangle.touchHandler);
|
||||
delete Bangle.touchHandler;
|
||||
}
|
||||
if (Bangle.touchHandler2) {
|
||||
Bangle.removeListener("touch", Bangle.touchHandler2);
|
||||
delete Bangle.touchHandler2;
|
||||
}
|
||||
delete Bangle.uiRedraw;
|
||||
delete Bangle.CLOCK;
|
||||
if (Bangle.uiRemove) {
|
||||
@ -99,8 +103,13 @@
|
||||
throw new Error("Unknown UI mode "+E.toJS(mode));
|
||||
if (options.clock) Bangle.CLOCK=1;
|
||||
if (options.touch) {
|
||||
Bangle.touchHandler = options.touch;
|
||||
Bangle.on("touch", Bangle.touchHandler);
|
||||
if (Bangle.touchHandler) { // don't overwrite existing touch handler if using updown/etc (#2648)
|
||||
Bangle.touchHandler2 = options.touch;
|
||||
Bangle.on("touch", Bangle.touchHandler2);
|
||||
} else {
|
||||
Bangle.touchHandler = options.touch;
|
||||
Bangle.on("touch", Bangle.touchHandler);
|
||||
}
|
||||
}
|
||||
if (options.drag) {
|
||||
Bangle.dragHandler = options.drag;
|
||||
|
||||
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