Skip to content

Commit 08c3766

Browse files
committed
notify: only stopEventPropagation() in event handlers
1 parent 215248f commit 08c3766

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

apps/notify/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
0.12: Add Bangle.js 2 support with Bangle.setLCDOverlay
1212
0.13: Add a default title background for the dark theme
1313
0.14: Stop event propagation on notification tap
14+
0.15: Only stop event propagation during events

apps/notify/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "notify",
33
"name": "Notifications (default)",
44
"shortName": "Notifications",
5-
"version": "0.14",
5+
"version": "0.15",
66
"author": "gfwilliams",
77
"description": "Provides the default `notify` module used by applications to display notifications on the screen. This module is installed by default by client applications such as the Gadgetbridge app. Installing `Fullscreen Notifications` replaces this module with a version that displays the notifications using the full screen",
88
"icon": "notify.png",

apps/notify/notify_bjs2.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,16 @@ exports.show = function(options) {
140140
if (pos > -size) setTimeout(anim, 15);
141141
}
142142
anim();
143-
Bangle.on("touch", exports.hide);
143+
Bangle.on("touch", onTouch);
144144
if (options.onHide)
145145
hideCallback = options.onHide;
146146
};
147147

148+
function onTouch() {
149+
E.stopEventPropagation && E.stopEventPropagation();
150+
exports.hide();
151+
}
152+
148153
/**
149154
options = {
150155
id // optional, only hide if current notification has this ID
@@ -156,8 +161,7 @@ exports.hide = function(options) {
156161
if (hideCallback) hideCallback({id:id});
157162
hideCallback = undefined;
158163
id = null;
159-
Bangle.removeListener("touch", exports.hide);
160-
E.stopEventPropagation && E.stopEventPropagation();
164+
Bangle.removeListener("touch", onTouch);
161165
function anim() {
162166
pos += 4;
163167
if (pos > 0) {

0 commit comments

Comments
 (0)