Skip to content

Commit abdc38b

Browse files
committed
Update utils.js
1 parent 2aa9b20 commit abdc38b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

utils.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,24 @@ function showDialog(confirmHandler, titleText, confirmText, showOneButton = fals
198198

199199
// add confirm button listener
200200
dialogConfirm.onclick = async (e) => {
201-
202-
e.stopPropagation();
203-
201+
204202
if (confirmHandler) await confirmHandler(e);
205203
resolve(true);
206204

207205
};
208206

209-
// add dialog click listener
210-
dialogWrapper.onclick = () => {
207+
// add cancel button listener
208+
dialogCancel.onclick = () => {
211209

212-
// if clicked anywhere else other than confirm button
210+
hideDialog();
211+
resolve(false);
212+
213+
};
214+
215+
// add dialog background click listener
216+
dialogBackground.onclick = () => {
217+
218+
hideDialog();
213219
resolve(false);
214220

215221
};
@@ -244,12 +250,6 @@ function hideDialog() {
244250

245251
}
246252

247-
// add cancel button click listener
248-
dialogCancel.addEventListener('click', hideDialog);
249-
250-
// add background click listener
251-
dialogBackground.addEventListener('click', hideDialog);
252-
253253

254254

255255
// device and platform queries

0 commit comments

Comments
 (0)