smpltmr: btn listener backwards compatibility

pull/3644/head
thyttan 2024-11-05 22:48:06 +01:00
parent 2bcbfa3b34
commit a3ecbe0657
1 changed files with 6 additions and 3 deletions

View File

@ -173,12 +173,15 @@ function updateLayoutField(layout, field, value) {
Bangle.loadWidgets();
Bangle.drawWidgets();
Bangle.setUI({
let uiOptions = {
mode : "custom",
touch : function(n,e) {onTouch(n,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);
if (timerRunning()) {