mirror of https://github.com/espruino/BangleApps
promenu: call `options.remove` when removed
parent
22078e87cc
commit
b2ff2eb47f
|
@ -11,3 +11,4 @@
|
||||||
0.07: Fix bug with alarms app (scroller) and correctly show images
|
0.07: Fix bug with alarms app (scroller) and correctly show images
|
||||||
0.08: Fix bug with modifying menu - allows hadash to save scroll positions
|
0.08: Fix bug with modifying menu - allows hadash to save scroll positions
|
||||||
0.09: Don't show "..." if a string isn't truncated (i.e. scrolled)
|
0.09: Don't show "..." if a string isn't truncated (i.e. scrolled)
|
||||||
|
0.10: Trigger `remove` callbacks when ending the menu
|
||||||
|
|
|
@ -193,9 +193,11 @@ E.showMenu = function (items) {
|
||||||
mode: "updown",
|
mode: "updown",
|
||||||
back: back,
|
back: back,
|
||||||
remove: function () {
|
remove: function () {
|
||||||
|
var _a;
|
||||||
if (nameScroller)
|
if (nameScroller)
|
||||||
clearInterval(nameScroller);
|
clearInterval(nameScroller);
|
||||||
Bangle.removeListener("swipe", onSwipe);
|
Bangle.removeListener("swipe", onSwipe);
|
||||||
|
(_a = options.remove) === null || _a === void 0 ? void 0 : _a.call(options);
|
||||||
},
|
},
|
||||||
}, function (dir) {
|
}, function (dir) {
|
||||||
if (dir)
|
if (dir)
|
||||||
|
|
|
@ -240,6 +240,7 @@ E.showMenu = (items?: Menu): MenuInstance => {
|
||||||
remove: () => {
|
remove: () => {
|
||||||
if (nameScroller) clearInterval(nameScroller);
|
if (nameScroller) clearInterval(nameScroller);
|
||||||
Bangle.removeListener("swipe", onSwipe);
|
Bangle.removeListener("swipe", onSwipe);
|
||||||
|
options.remove?.();
|
||||||
},
|
},
|
||||||
} as SetUIArg<"updown">,
|
} as SetUIArg<"updown">,
|
||||||
dir => {
|
dir => {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "promenu",
|
"id": "promenu",
|
||||||
"name": "Pro Menu",
|
"name": "Pro Menu",
|
||||||
"version": "0.09",
|
"version": "0.10",
|
||||||
"description": "Replace the built in menu function. Supports Bangle.js 1 and Bangle.js 2.",
|
"description": "Replace the built in menu function. Supports Bangle.js 1 and Bangle.js 2.",
|
||||||
"icon": "icon.png",
|
"icon": "icon.png",
|
||||||
"type": "bootloader",
|
"type": "bootloader",
|
||||||
|
|
Loading…
Reference in New Issue