mirror of https://github.com/espruino/BangleApps
smpltmr: btn listener backwards compatibility
parent
2bcbfa3b34
commit
a3ecbe0657
|
@ -173,12 +173,15 @@ function updateLayoutField(layout, field, value) {
|
||||||
Bangle.loadWidgets();
|
Bangle.loadWidgets();
|
||||||
Bangle.drawWidgets();
|
Bangle.drawWidgets();
|
||||||
|
|
||||||
Bangle.setUI({
|
let uiOptions = {
|
||||||
mode : "custom",
|
mode : "custom",
|
||||||
touch : function(n,e) {onTouch(n,e);},
|
touch : function(n,e) {onTouch(n,e);},
|
||||||
drag : function(e) {onDrag(e);},
|
drag : function(e) {onDrag(e);},
|
||||||
btnRelease : function(n) {onButton();},
|
};
|
||||||
});
|
if (parseFloat(process.env.VERSION.replace("v","")) < 224.164) {uiOptions.btn = function(n) {onButton();};}
|
||||||
|
else {uiOptions.btnRelease = function(n) {onButton();};}
|
||||||
|
|
||||||
|
Bangle.setUI(uiOptions);
|
||||||
|
|
||||||
g.clearRect(Bangle.appRect);
|
g.clearRect(Bangle.appRect);
|
||||||
if (timerRunning()) {
|
if (timerRunning()) {
|
||||||
|
|
Loading…
Reference in New Issue