Merge pull request #3682 from bobrippling/feat/promenu-remove

promenu: call `options.remove` when removed
pull/3691/head
Rob Pilling 2024-12-11 18:40:02 +00:00 committed by GitHub
commit f96440520e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 1 deletions

View File

@ -11,3 +11,4 @@
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.09: Don't show "..." if a string isn't truncated (i.e. scrolled)
0.10: Trigger `remove` callbacks when ending the menu

View File

@ -193,9 +193,11 @@ E.showMenu = function (items) {
mode: "updown",
back: back,
remove: function () {
var _a;
if (nameScroller)
clearInterval(nameScroller);
Bangle.removeListener("swipe", onSwipe);
(_a = options.remove) === null || _a === void 0 ? void 0 : _a.call(options);
},
}, function (dir) {
if (dir)

View File

@ -240,6 +240,7 @@ E.showMenu = (items?: Menu): MenuInstance => {
remove: () => {
if (nameScroller) clearInterval(nameScroller);
Bangle.removeListener("swipe", onSwipe);
options.remove?.();
},
} as SetUIArg<"updown">,
dir => {

View File

@ -1,7 +1,7 @@
{
"id": "promenu",
"name": "Pro Menu",
"version": "0.09",
"version": "0.10",
"description": "Replace the built in menu function. Supports Bangle.js 1 and Bangle.js 2.",
"icon": "icon.png",
"type": "bootloader",