mirror of https://github.com/xwiki-labs/cryptpad
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
This commit is contained in:
parent
7f41f8765e
commit
6413be24f3
|
@ -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'); }
|
||||
|
|
Loading…
Reference in New Issue