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();
|
||||
}
|
||||
Bangle.on("swipe",swipeHandler);
|
||||
const unfocus = () => {
|
||||
const blur = () => {
|
||||
options.focus=false;
|
||||
delete Bangle.CLKINFO_FOCUS;
|
||||
options.redraw();
|
||||
const itm = menu[options.menuA].items[options.menuB];
|
||||
if (itm.unfocus) itm.unfocus(options);
|
||||
if (itm.blur) itm.blur(options);
|
||||
};
|
||||
const focus = (redraw) => {
|
||||
if (!options.focus) {
|
||||
|
@ -306,7 +306,7 @@ exports.addInteractive = function(menu, options) {
|
|||
if (e.x<options.x || e.y<options.y ||
|
||||
e.x>(options.x+options.w) || e.y>(options.y+options.h)) {
|
||||
if (options.focus)
|
||||
unfocus();
|
||||
blur();
|
||||
return; // outside area
|
||||
}
|
||||
if (!options.focus) {
|
||||
|
@ -322,7 +322,7 @@ exports.addInteractive = function(menu, options) {
|
|||
if (settings.defocusOnLock) {
|
||||
lockHandler = function() {
|
||||
if(options.focus)
|
||||
unfocus();
|
||||
blur();
|
||||
};
|
||||
Bangle.on("lock", lockHandler);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ declare module ClockInfo {
|
|||
on(what: "redraw", cb: () => void): void, // extending from Object
|
||||
run?(options: InteractiveOptions): void,
|
||||
focus?(options: InteractiveOptions): void,
|
||||
unfocus?(options: InteractiveOptions): void,
|
||||
blur?(options: InteractiveOptions): void,
|
||||
} & (
|
||||
{
|
||||
hasRange: true,
|
||||
|
|
Loading…
Reference in New Issue