diff options
Diffstat (limited to 'web_src/js/features/comp/ReactionSelector.js')
-rw-r--r-- | web_src/js/features/comp/ReactionSelector.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/web_src/js/features/comp/ReactionSelector.js b/web_src/js/features/comp/ReactionSelector.js index 272ea45cdd..26c9af2ff3 100644 --- a/web_src/js/features/comp/ReactionSelector.js +++ b/web_src/js/features/comp/ReactionSelector.js @@ -1,16 +1,20 @@ import $ from 'jquery'; +import {createTippy} from '../../modules/tippy.js'; + const {csrfToken} = window.config; export function initCompReactionSelector(parent) { - let reactions = ''; + let selector = 'a.label'; if (!parent) { parent = $(document); - reactions = '.reactions > '; + selector = `.reactions ${selector}`; } - parent.find(`${reactions}a.label`).popup({position: 'bottom left', metadata: {content: 'title', title: 'none'}}); + for (const el of parent[0].querySelectorAll(selector)) { + createTippy(el, {placement: 'bottom-start', content: el.getAttribute('data-title')}); + } - parent.find(`.select-reaction > .menu > .item, ${reactions}a.label`).on('click', function (e) { + parent.find(`.select-reaction > .menu > .item, ${selector}`).on('click', function (e) { e.preventDefault(); if ($(this).hasClass('disabled')) return; |