0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-29 01:22:07 +01:00

Move Tippy hooks to separate arrow function declarations

This commit is contained in:
Sage Abdullah 2024-01-25 10:11:07 +00:00 committed by sag​e
parent ea288448cd
commit 6991c1f2d9

View File

@ -144,12 +144,21 @@ export class DropdownController extends Controller<HTMLElement> {
});
}
const onShow = () => {
if (hoverTooltipInstance) {
hoverTooltipInstance.disable();
}
};
const onShown = () => {
this.dispatch('shown');
};
const onHide = () => {
this.dispatch('hide');
if (hoverTooltipInstance) {
hoverTooltipInstance.enable();
}
};
return {
@ -162,20 +171,9 @@ export class DropdownController extends Controller<HTMLElement> {
...(this.hasOffsetValue && { offset: this.offsetValue }),
getReferenceClientRect: () => this.reference.getBoundingClientRect(),
theme: this.themeValue,
onShow() {
if (hoverTooltipInstance) {
hoverTooltipInstance.disable();
}
},
onShown() {
onShown();
},
onHide() {
if (hoverTooltipInstance) {
hoverTooltipInstance.enable();
}
onHide();
},
onShow,
onShown,
onHide,
};
}