Replace fomantic popup module with tippy.js (#20428)
- replace fomantic popup module with tippy.js - fix chaining and add comment - add 100ms delay to tooltips - stopwatch improvments, raise default maxWidth - update web_src/js/features/common-global.js - use type=submit instead of js
This commit is contained in:
parent
36f9ee5813
commit
1b2cd4c4e1
28 changed files with 199 additions and 2129 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue