Skip to content

Commit cb30446

Browse files
committed
fix
1 parent 58015ba commit cb30446

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

web_src/js/features/common-global.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import {svg} from '../svg.js';
88
import {hideElem, showElem, toggleElem} from '../utils/dom.js';
99
import {htmlEscape} from 'escape-goat';
1010
import {createTippy} from '../modules/tippy.js';
11-
import {confirmModal} from "./comp/ConfirmModal.js";
11+
import {confirmModal} from './comp/ConfirmModal.js';
1212

13-
const {appUrl, csrfToken, i18n} = window.config;
13+
const {appUrl, csrfToken} = window.config;
1414

1515
export function initGlobalFormDirtyLeaveConfirm() {
1616
// Warn users that try to leave a page after entering data into a form.

web_src/js/features/repo-issue-list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {updateIssuesMeta} from './repo-issue.js';
33
import {toggleElem} from '../utils/dom.js';
44
import {htmlEscape} from 'escape-goat';
55
import {Sortable} from 'sortablejs';
6-
import {confirmModal} from "./comp/ConfirmModal.js";
6+
import {confirmModal} from './comp/ConfirmModal.js';
77

88
function initRepoIssueListCheckboxes() {
99
const $issueSelectAll = $('.issue-checkbox-all');

web_src/js/modules/tippy.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ import tippy from 'tippy.js';
33
const visibleInstances = new Set();
44

55
export function createTippy(target, opts = {}) {
6-
const {role, content, onHide: optsOnHide, onDestroy: optsOnDestroy, onShow: optOnShow} = opts;
7-
delete opts.onHide;
8-
delete opts.onDestroy;
9-
delete opts.onShow;
10-
6+
const {onHide, onShow, onDestroy, ...other} = opts;
117
const instance = tippy(target, {
128
appendTo: document.body,
139
animation: false,
@@ -18,11 +14,11 @@ export function createTippy(target, opts = {}) {
1814
maxWidth: 500, // increase over default 350px
1915
onHide: (instance) => {
2016
visibleInstances.delete(instance);
21-
return optsOnHide?.(instance);
17+
return onHide?.(instance);
2218
},
2319
onDestroy: (instance) => {
2420
visibleInstances.delete(instance);
25-
return optsOnDestroy?.(instance);
21+
return onDestroy?.(instance);
2622
},
2723
onShow: (instance) => {
2824
// hide other tooltip instances so only one tooltip shows at a time
@@ -32,19 +28,19 @@ export function createTippy(target, opts = {}) {
3228
}
3329
}
3430
visibleInstances.add(instance);
35-
return optOnShow?.(instance);
31+
return onShow?.(instance);
3632
},
3733
arrow: `<svg width="16" height="7"><path d="m0 7 8-7 8 7Z" class="tippy-svg-arrow-outer"/><path d="m0 8 8-7 8 7Z" class="tippy-svg-arrow-inner"/></svg>`,
3834
role: 'menu', // HTML role attribute, only tooltips should use "tooltip"
39-
theme: role || 'menu', // CSS theme, we support either "tooltip" or "menu"
40-
...opts,
35+
theme: other.role || 'menu', // CSS theme, we support either "tooltip" or "menu"
36+
...other,
4137
});
4238

4339
// for popups where content refers to a DOM element, we use the 'tippy-target' class
4440
// to initially hide the content, now we can remove it as the content has been removed
4541
// from the DOM by tippy
46-
if (content instanceof Element) {
47-
content.classList.remove('tippy-target');
42+
if (other.content instanceof Element) {
43+
other.content.classList.remove('tippy-target');
4844
}
4945

5046
return instance;

0 commit comments

Comments
 (0)