Skip to content

Commit 1f4463a

Browse files
committed
Revert "destructure all the things"
This reverts commit 868d059.
1 parent b1ddb8c commit 1f4463a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

web_src/js/modules/tippy.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import tippy from 'tippy.js';
22

33
const visibleInstances = new Set();
44

5-
export function createTippy(target, {onHide, onShow, onDestroy, role, content, ...other} = {}) {
5+
export function createTippy(target, opts = {}) {
6+
const {onHide, onShow, onDestroy, ...other} = opts;
67
const instance = tippy(target, {
78
appendTo: document.body,
89
animation: false,
@@ -31,16 +32,15 @@ export function createTippy(target, {onHide, onShow, onDestroy, role, content, .
3132
},
3233
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>`,
3334
role: 'menu', // HTML role attribute, only tooltips should use "tooltip"
34-
theme: role || 'menu', // CSS theme, we support either "tooltip" or "menu"
35-
content,
35+
theme: other.role || 'menu', // CSS theme, we support either "tooltip" or "menu"
3636
...other,
3737
});
3838

3939
// for popups where content refers to a DOM element, we use the 'tippy-target' class
4040
// to initially hide the content, now we can remove it as the content has been removed
4141
// from the DOM by tippy
42-
if (content instanceof Element) {
43-
content.classList.remove('tippy-target');
42+
if (other.content instanceof Element) {
43+
other.content.classList.remove('tippy-target');
4444
}
4545

4646
return instance;

0 commit comments

Comments
 (0)