Skip to content

Commit 372dfed

Browse files
committed
promenu: generate js
1 parent 5ae4723 commit 372dfed

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

apps/promenu/bootb2.js

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ var _a, _b;
22
var prosettings = (require("Storage").readJSON("promenu.settings.json", true) || {});
33
(_a = prosettings.naturalScroll) !== null && _a !== void 0 ? _a : (prosettings.naturalScroll = false);
44
(_b = prosettings.wrapAround) !== null && _b !== void 0 ? _b : (prosettings.wrapAround = true);
5-
E.showMenu = function (items) {
5+
E.showMenu = (function (items) {
6+
if (items == null) {
7+
g.clearRect(Bangle.appRect);
8+
return Bangle.setUI();
9+
}
610
var RectRnd = function (x1, y1, x2, y2, r) {
711
var pp = [];
812
pp.push.apply(pp, g.quadraticBezier([x2 - r, y1, x2, y1, x2, y1 + r]));
@@ -204,19 +208,29 @@ E.showMenu = function (items) {
204208
else
205209
l.select(evt);
206210
};
207-
Bangle.setUI({
211+
var touchcb = (function (_button, xy) {
212+
cb(void 0, xy);
213+
});
214+
var uiopts = {
208215
mode: "updown",
209216
back: back,
210217
remove: function () {
211218
var _a;
212219
if (nameScroller)
213220
clearInterval(nameScroller);
214221
Bangle.removeListener("swipe", onSwipe);
222+
if (is2v26_27)
223+
Bangle.removeListener("touch", touchcb);
215224
(_a = options.remove) === null || _a === void 0 ? void 0 : _a.call(options);
216225
},
217-
touch: (function (_button, xy) {
218-
cb(void 0, xy);
219-
}),
220-
}, cb);
226+
};
227+
var is2v26_27 = process.env.VERSION === "2v26" || process.env.VERSION === "2v27";
228+
if (!is2v26_27) {
229+
uiopts.touch = touchcb;
230+
}
231+
Bangle.setUI(uiopts, cb);
232+
if (is2v26_27) {
233+
Bangle.on("touch", touchcb);
234+
}
221235
return l;
222-
};
236+
});

0 commit comments

Comments
 (0)