1
0
Fork 0

Update app.js

master
naden 2024-03-01 21:32:08 +01:00 committed by GitHub
parent 867474fbb0
commit 465673bd56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 26 deletions

View File

@ -90,7 +90,7 @@ function Regattatimer() {
Bangle.setLCDPower(1);
Bangle.setLCDTimeout(0);
/*
// in "idle", "start" or "stoped" mode, a button click (re)starts the countdown
// in "race" mode, a button click stops the counter
var onButtonClick = (function(ev) {
@ -116,35 +116,10 @@ function Regattatimer() {
}).bind(this);
setWatch(onButtonClick, BTN1, true);
*/
setWatch(this.onButtonClick.binf(this), BTN1, true);
this.setLayoutIdle();
},
onButtonClick: function(ev) {
switch(this.mode) {
case "idle":
this.resetCounter();
this.mode = "start";
this.setLayoutStartMinSec();
this.startCounter();
this.interval = setInterval((function() {
this.startCounter();
}).bind(this), 1000);
break;
case "stoped":
case "start":
this.resetCounter();
this.setLayoutIdle();
break;
case "race":
this.raceCounterStop();
break;
}
},
onGPS: function(fix) {
if(this.mode == "race") {
if(fix.fix && isFinite(fix.speed)) {