forked from forgejo/forgejo
Init popup for new code comment (#20234)
- Initialize the popup for the tooltip inside the new code comment. - This works and is good enough to have this issue fixed for 1.17 Fix #20068
This commit is contained in:
parent
f5c97172f0
commit
ed13d7aadf
3 changed files with 18 additions and 9 deletions
|
@ -75,6 +75,20 @@ export function initGlobalButtonClickOnEnter() {
|
|||
});
|
||||
}
|
||||
|
||||
export function initPopup(target) {
|
||||
const $el = $(target);
|
||||
const attr = $el.attr('data-variation');
|
||||
const attrs = attr ? attr.split(' ') : [];
|
||||
const variations = new Set([...attrs, 'inverted', 'tiny']);
|
||||
$el.attr('data-variation', [...variations].join(' ')).popup();
|
||||
}
|
||||
|
||||
export function initGlobalPopups() {
|
||||
$('.tooltip').each((_, el) => {
|
||||
initPopup(el);
|
||||
});
|
||||
}
|
||||
|
||||
export function initGlobalCommon() {
|
||||
// Show exact time
|
||||
$('.time-since').each(function () {
|
||||
|
@ -121,15 +135,6 @@ export function initGlobalCommon() {
|
|||
|
||||
$('.ui.checkbox').checkbox();
|
||||
|
||||
// init popups
|
||||
$('.tooltip').each((_, el) => {
|
||||
const $el = $(el);
|
||||
const attr = $el.attr('data-variation');
|
||||
const attrs = attr ? attr.split(' ') : [];
|
||||
const variations = new Set([...attrs, 'inverted', 'tiny']);
|
||||
$el.attr('data-variation', [...variations].join(' ')).popup();
|
||||
});
|
||||
|
||||
$('.top.menu .tooltip').popup({
|
||||
onShow() {
|
||||
if ($('.top.menu .menu.transition').hasClass('visible')) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue