mirror of https://github.com/espruino/BangleApps
clock_info: s/unfocus/blur/
parent
8f86d9297b
commit
2c92c94574
|
@ -284,12 +284,12 @@ exports.addInteractive = function(menu, options) {
|
||||||
E.stopEventPropagation&&E.stopEventPropagation();
|
E.stopEventPropagation&&E.stopEventPropagation();
|
||||||
}
|
}
|
||||||
Bangle.on("swipe",swipeHandler);
|
Bangle.on("swipe",swipeHandler);
|
||||||
const unfocus = () => {
|
const blur = () => {
|
||||||
options.focus=false;
|
options.focus=false;
|
||||||
delete Bangle.CLKINFO_FOCUS;
|
delete Bangle.CLKINFO_FOCUS;
|
||||||
options.redraw();
|
options.redraw();
|
||||||
const itm = menu[options.menuA].items[options.menuB];
|
const itm = menu[options.menuA].items[options.menuB];
|
||||||
if (itm.unfocus) itm.unfocus(options);
|
if (itm.blur) itm.blur(options);
|
||||||
};
|
};
|
||||||
const focus = (redraw) => {
|
const focus = (redraw) => {
|
||||||
if (!options.focus) {
|
if (!options.focus) {
|
||||||
|
@ -306,7 +306,7 @@ exports.addInteractive = function(menu, options) {
|
||||||
if (e.x<options.x || e.y<options.y ||
|
if (e.x<options.x || e.y<options.y ||
|
||||||
e.x>(options.x+options.w) || e.y>(options.y+options.h)) {
|
e.x>(options.x+options.w) || e.y>(options.y+options.h)) {
|
||||||
if (options.focus)
|
if (options.focus)
|
||||||
unfocus();
|
blur();
|
||||||
return; // outside area
|
return; // outside area
|
||||||
}
|
}
|
||||||
if (!options.focus) {
|
if (!options.focus) {
|
||||||
|
@ -322,7 +322,7 @@ exports.addInteractive = function(menu, options) {
|
||||||
if (settings.defocusOnLock) {
|
if (settings.defocusOnLock) {
|
||||||
lockHandler = function() {
|
lockHandler = function() {
|
||||||
if(options.focus)
|
if(options.focus)
|
||||||
unfocus();
|
blur();
|
||||||
};
|
};
|
||||||
Bangle.on("lock", lockHandler);
|
Bangle.on("lock", lockHandler);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ declare module ClockInfo {
|
||||||
on(what: "redraw", cb: () => void): void, // extending from Object
|
on(what: "redraw", cb: () => void): void, // extending from Object
|
||||||
run?(options: InteractiveOptions): void,
|
run?(options: InteractiveOptions): void,
|
||||||
focus?(options: InteractiveOptions): void,
|
focus?(options: InteractiveOptions): void,
|
||||||
unfocus?(options: InteractiveOptions): void,
|
blur?(options: InteractiveOptions): void,
|
||||||
} & (
|
} & (
|
||||||
{
|
{
|
||||||
hasRange: true,
|
hasRange: true,
|
||||||
|
|
Loading…
Reference in New Issue