From 6413be24f362cc9e4cd9603679646a43e28d04bd Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 12 Aug 2021 19:04:09 +0530 Subject: [PATCH] apply a click handler with vanilla js instead of jquery the jquery method only worked ~50% of the time in Firefox 90 for a completely unknown reason --- www/common/common-ui-elements.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 67f39f3ff..19a124180 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -919,10 +919,13 @@ define([ }, [ h('i.fa.' + icon), h('span.cp-toolbar-name'+drawerCls, data.text) - ])).click(common.prepareFeedback(data.name || 'DEFAULT')); - if (callback) { - button.click(callback); - } + ])); + var feedbackHandler = common.prepareFeedback(data.name || 'DEFAULT'); + button[0].addEventListener('click', function () { + feedbackHandler(); + if (typeof(callback) !== 'function') { return; } + callback(); + }); if (data.style) { button.attr('style', data.style); } if (data.id) { button.attr('id', data.id); } if (data.hiddenReadOnly) { button.addClass('cp-hidden-if-readonly'); }