mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-25 05:02:57 +01:00
Move Tippy hooks to separate arrow function declarations
This commit is contained in:
parent
ea288448cd
commit
6991c1f2d9
@ -144,12 +144,21 @@ export class DropdownController extends Controller<HTMLElement> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onShow = () => {
|
||||||
|
if (hoverTooltipInstance) {
|
||||||
|
hoverTooltipInstance.disable();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const onShown = () => {
|
const onShown = () => {
|
||||||
this.dispatch('shown');
|
this.dispatch('shown');
|
||||||
};
|
};
|
||||||
|
|
||||||
const onHide = () => {
|
const onHide = () => {
|
||||||
this.dispatch('hide');
|
this.dispatch('hide');
|
||||||
|
if (hoverTooltipInstance) {
|
||||||
|
hoverTooltipInstance.enable();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -162,20 +171,9 @@ export class DropdownController extends Controller<HTMLElement> {
|
|||||||
...(this.hasOffsetValue && { offset: this.offsetValue }),
|
...(this.hasOffsetValue && { offset: this.offsetValue }),
|
||||||
getReferenceClientRect: () => this.reference.getBoundingClientRect(),
|
getReferenceClientRect: () => this.reference.getBoundingClientRect(),
|
||||||
theme: this.themeValue,
|
theme: this.themeValue,
|
||||||
onShow() {
|
onShow,
|
||||||
if (hoverTooltipInstance) {
|
onShown,
|
||||||
hoverTooltipInstance.disable();
|
onHide,
|
||||||
}
|
|
||||||
},
|
|
||||||
onShown() {
|
|
||||||
onShown();
|
|
||||||
},
|
|
||||||
onHide() {
|
|
||||||
if (hoverTooltipInstance) {
|
|
||||||
hoverTooltipInstance.enable();
|
|
||||||
}
|
|
||||||
onHide();
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user