Skip to content

Commit f964405

Browse files
authored
Merge pull request espruino#3682 from bobrippling/feat/promenu-remove
promenu: call `options.remove` when removed
2 parents 516b74f + 9987a2d commit f964405

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

apps/promenu/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
0.07: Fix bug with alarms app (scroller) and correctly show images
1212
0.08: Fix bug with modifying menu - allows hadash to save scroll positions
1313
0.09: Don't show "..." if a string isn't truncated (i.e. scrolled)
14+
0.10: Trigger `remove` callbacks when ending the menu

apps/promenu/bootb2.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,11 @@ E.showMenu = function (items) {
193193
mode: "updown",
194194
back: back,
195195
remove: function () {
196+
var _a;
196197
if (nameScroller)
197198
clearInterval(nameScroller);
198199
Bangle.removeListener("swipe", onSwipe);
200+
(_a = options.remove) === null || _a === void 0 ? void 0 : _a.call(options);
199201
},
200202
}, function (dir) {
201203
if (dir)

apps/promenu/bootb2.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ E.showMenu = (items?: Menu): MenuInstance => {
240240
remove: () => {
241241
if (nameScroller) clearInterval(nameScroller);
242242
Bangle.removeListener("swipe", onSwipe);
243+
options.remove?.();
243244
},
244245
} as SetUIArg<"updown">,
245246
dir => {

apps/promenu/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "promenu",
33
"name": "Pro Menu",
4-
"version": "0.09",
4+
"version": "0.10",
55
"description": "Replace the built in menu function. Supports Bangle.js 1 and Bangle.js 2.",
66
"icon": "icon.png",
77
"type": "bootloader",

0 commit comments

Comments
 (0)