button exits the calendar
parent
70d50ce4d3
commit
e5d806b5eb
|
|
@ -156,7 +156,7 @@ function drawSeconds() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawWatch() {
|
function drawWatch() {
|
||||||
if (DEBUG) console.log("CALENDAR");
|
if (DEBUG) console.log("DRAWWATCH");
|
||||||
monthOffset = 0;
|
monthOffset = 0;
|
||||||
state = "watch";
|
state = "watch";
|
||||||
var d = new Date();
|
var d = new Date();
|
||||||
|
|
@ -197,6 +197,7 @@ function drawWatch() {
|
||||||
if (DEBUG) console.log("Next Day:" + (nextday / 3600));
|
if (DEBUG) console.log("Next Day:" + (nextday / 3600));
|
||||||
if (typeof dayInterval !== "undefined") clearTimeout(dayInterval);
|
if (typeof dayInterval !== "undefined") clearTimeout(dayInterval);
|
||||||
dayInterval = setTimeout(drawWatch, nextday * 1000);
|
dayInterval = setTimeout(drawWatch, nextday * 1000);
|
||||||
|
if (DEBUG) console.log("ended DRAWWATCH. next refresh in " + nextday + "s");
|
||||||
}
|
}
|
||||||
|
|
||||||
function BTevent() {
|
function BTevent() {
|
||||||
|
|
@ -211,8 +212,11 @@ function action(a) {
|
||||||
g.reset();
|
g.reset();
|
||||||
if (typeof secondInterval !== "undefined") clearTimeout(secondInterval);
|
if (typeof secondInterval !== "undefined") clearTimeout(secondInterval);
|
||||||
if (DEBUG) console.log("action:" + a);
|
if (DEBUG) console.log("action:" + a);
|
||||||
|
state = "unknown";
|
||||||
|
console.log("state -> unknown");
|
||||||
switch (a) {
|
switch (a) {
|
||||||
case "[ignore]":
|
case "[ignore]":
|
||||||
|
drawWatch();
|
||||||
break;
|
break;
|
||||||
case "[calend.]":
|
case "[calend.]":
|
||||||
drawFullCalendar();
|
drawFullCalendar();
|
||||||
|
|
@ -276,7 +280,6 @@ function input(dir) {
|
||||||
drawWatch();
|
drawWatch();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -309,3 +312,10 @@ NRF.on('disconnect', BTevent);
|
||||||
dimSeconds = Bangle.isLocked();
|
dimSeconds = Bangle.isLocked();
|
||||||
drawWatch();
|
drawWatch();
|
||||||
|
|
||||||
|
setWatch(function() {
|
||||||
|
if (state == "watch") {
|
||||||
|
Bangle.showLauncher()
|
||||||
|
} else if (state == "calendar") {
|
||||||
|
drawWatch();
|
||||||
|
}
|
||||||
|
}, BTN1, {repeat:true, edge:"falling"});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue