We will add two drag handlers, the mode "updown" one and the custom one. But we will only keep the custom handler in Bangle.dragHandler. So if we call Bangle.setUI() to clear everything we will leave the "updown" drag handler still active.
should we make Bangle.dragHandler hold an array instead? Should it be renamed in that case?
or should we add another Bangle.dragHandlerCustom to keep track of them in two separate places?
This doesn't happen for the touch handlers since we only add the last of them at the end of setUI's code. I wonder if we should change this so they add to each other rather than overwrite, like for drag, in order to preserve the callback functionality mode "updown" provides even when a custom handler is added.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
@woogal
I've pushed a version 0.02 with a fix to the development app loader: https://espruino.github.io/BangleApps/?id=setuichange
I also realized there's a bug where if you do e.g.
We will add two drag handlers, the mode "updown" one and the custom one. But we will only keep the custom handler in
Bangle.dragHandler
. So if we callBangle.setUI()
to clear everything we will leave the"updown"
drag handler still active.@Gordon what do you reccon:
Bangle.dragHandler
hold an array instead? Should it be renamed in that case?Bangle.dragHandlerCustom
to keep track of them in two separate places?This doesn't happen for the touch handlers since we only add the last of them at the end of setUI's code. I wonder if we should change this so they add to each other rather than overwrite, like for drag, in order to preserve the callback functionality mode "updown" provides even when a custom handler is added.