Merge pull request #3601 from bobrippling/fix/promenu-mutate

promenu: don't modify the menu object
pull/3605/head
thyttan 2024-10-03 15:36:23 +02:00 committed by GitHub
commit 4861719176
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 6 deletions

View File

@ -9,3 +9,4 @@
handling of E.showMenu() with no arguments
0.06: Fix lower bounding of numeric values
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

View File

@ -13,9 +13,7 @@ E.showMenu = function (items) {
g.setColor(255, 255, 255);
};
var options = items && items[""] || {};
if (items)
delete items[""];
var menuItems = Object.keys(items);
var menuItems = Object.keys(items).filter(function (x) { return x.length; });
var fontHeight = options.fontHeight || 25;
var selected = options.scroll || options.selected || 0;
var ar = Bangle.appRect;

View File

@ -15,8 +15,7 @@ E.showMenu = (items?: Menu): MenuInstance => {
g.setColor(255, 255, 255);
};
let options = items && items[""] || {};
if (items) delete items[""];
const menuItems = Object.keys(items);
const menuItems = Object.keys(items).filter(x => x.length);
const fontHeight = options.fontHeight||25;

View File

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