From fae9122cf7341083124cb76e82a5a1062e31b5b6 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Mon, 15 Feb 2016 01:05:24 +0500 Subject: [PATCH] make alertPopup() available to use on events --- js/interface_common.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/js/interface_common.js b/js/interface_common.js index 51ef9a2..7f29eae 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -338,9 +338,16 @@ function confirmPopup(req) { function alertPopup(req) { if (!req) return; - if (!req.txtConfirm) - req.txtConfirm = polyglot.t('btn_ok'); - req.removeCancel = true; + if (typeof req.stopPropagation === 'function') { + if (typeof req.data !== 'object') return; + if (!req.data.txtConfirm) + req.data.txtConfirm = polyglot.t('btn_ok'); + req.data.removeCancel = true; + } else { + if (!req.txtConfirm) + req.txtConfirm = polyglot.t('btn_ok'); + req.removeCancel = true; + } confirmPopup(req); }