Fix draw define first
parent
274b51853f
commit
ffc8d201e3
|
|
@ -56,10 +56,7 @@
|
||||||
WIDGETS["widsmartbatt"] = {
|
WIDGETS["widsmartbatt"] = {
|
||||||
area: "tr",
|
area: "tr",
|
||||||
width: 30,
|
width: 30,
|
||||||
draw: function() {
|
draw: draw
|
||||||
// Call your drawing function
|
|
||||||
draw();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Touch to temporarily show battery percent
|
// Touch to temporarily show battery percent
|
||||||
|
|
@ -73,7 +70,6 @@
|
||||||
if (w.x - oversize <= x && x < w.x + width + oversize
|
if (w.x - oversize <= x && x < w.x + width + oversize
|
||||||
&& w.y - oversize <= y && y < w.y + height + oversize) {
|
&& w.y - oversize <= y && y < w.y + height + oversize) {
|
||||||
E.stopEventPropagation && E.stopEventPropagation();
|
E.stopEventPropagation && E.stopEventPropagation();
|
||||||
Bangle.buzz(20);
|
|
||||||
showPercent = true;
|
showPercent = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
showPercent = false;
|
showPercent = false;
|
||||||
|
|
@ -87,7 +83,7 @@
|
||||||
Bangle.on('charging', function () {
|
Bangle.on('charging', function () {
|
||||||
WIDGETS["widsmartbatt"].draw();
|
WIDGETS["widsmartbatt"].draw();
|
||||||
});
|
});
|
||||||
//draw once per minute...
|
|
||||||
var id = setInterval(() => WIDGETS["widsmartbatt"].draw(), 60000);
|
var id = setInterval(() => WIDGETS["widsmartbatt"].draw(), 60000);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue