From 00d3876c8582e6b706f5f21a7c57dfee209a017c Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 19 Jul 2022 00:33:34 +0200 Subject: Use tippy.js for context popup (#20393) By appending the tooltips to `document.body`, we can avoid any stacking context issues caused by surrounding element's CSS. This uses [tippy.js](https://github.com/atomiks/tippyjs) instead of Fomantic popups. We should aim to replace all Fomantic popups with this eventually and then get rid of the Fomantic `popup` module completely. --- web_src/js/features/contextpopup.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'web_src/js/features') diff --git a/web_src/js/features/contextpopup.js b/web_src/js/features/contextpopup.js index 0cd47bf2bc..f4e660be3f 100644 --- a/web_src/js/features/contextpopup.js +++ b/web_src/js/features/contextpopup.js @@ -2,6 +2,7 @@ import $ from 'jquery'; import Vue from 'vue'; import ContextPopup from '../components/ContextPopup.vue'; import {parseIssueHref} from '../utils.js'; +import {createTippy} from '../modules/tippy.js'; export default function initContextPopups() { const refIssues = $('.ref-issue'); @@ -16,7 +17,6 @@ export default function initContextPopups() { if (!owner) return; const el = document.createElement('div'); - el.className = 'ui custom popup hidden'; el.innerHTML = '
'; this.parentNode.insertBefore(el, this.nextSibling); @@ -33,17 +33,12 @@ export default function initContextPopups() { el.textContent = 'ContextPopup failed to load'; } - $(this).popup({ - variation: 'wide', - delay: { - show: 250 - }, + createTippy(this, { + content: el, + interactive: true, onShow: () => { - view.$emit('load-context-popup', {owner, repo, index}, () => { - $(this).popup('reposition'); - }); - }, - popup: $(el), + view.$emit('load-context-popup', {owner, repo, index}); + } }); }); } -- cgit v1.2.3