mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-27 21:05:53 +00:00
4.5.0
* Added: Setting to hide the "LIVE" indicator on live channel pages. * Added: Setting to invert portrait mode, placing chat at the top rather than the bottom. * API Added: New icons to the default icon set: `user`, `clip`, `sort-down`, `sort-up`, `sort-alt-up`, `sort-alt-down`, and `language`. * API Added: All Vue components now have access to a `getReactURL(route, ...)` method for building URLs. * API Fixed: `<react-link />` will not attempt a React navigation if given a non-relative link. * API Fixed: Issue with `getTagImmediate` throwing an exception when not given a callback function.
This commit is contained in:
parent
80148e5579
commit
3c00c0946e
19 changed files with 189 additions and 22 deletions
|
@ -31,6 +31,30 @@ export default class TooltipProvider extends Module {
|
|||
]
|
||||
}
|
||||
|
||||
this.types.child = target => {
|
||||
const child = target.querySelector(':scope > .ffz-tooltip-child');
|
||||
if ( ! child )
|
||||
return null;
|
||||
|
||||
target._ffz_child = child;
|
||||
child.remove();
|
||||
child.classList.remove('ffz-tooltip-child');
|
||||
return child;
|
||||
};
|
||||
|
||||
this.types.child.onHide = target => {
|
||||
const child = target._ffz_child;
|
||||
if ( child ) {
|
||||
target._ffz_child = null;
|
||||
child.remove();
|
||||
|
||||
if ( ! target.querySelector(':scope > .ffz-tooltip-child') ) {
|
||||
child.classList.add('ffz-tooltip-child');
|
||||
target.appendChild(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.types.text = target => sanitize(target.dataset.title);
|
||||
this.types.html = target => target.dataset.title;
|
||||
}
|
||||
|
@ -46,6 +70,10 @@ export default class TooltipProvider extends Module {
|
|||
content: this.process.bind(this),
|
||||
interactive: this.checkInteractive.bind(this),
|
||||
hover_events: this.checkHoverEvents.bind(this),
|
||||
|
||||
onShow: this.delegateOnShow.bind(this),
|
||||
onHide: this.delegateOnHide.bind(this),
|
||||
|
||||
popper: {
|
||||
placement: 'top',
|
||||
modifiers: {
|
||||
|
@ -74,6 +102,22 @@ export default class TooltipProvider extends Module {
|
|||
this.tips.cleanup();
|
||||
}
|
||||
|
||||
delegateOnShow(target, tip) {
|
||||
const type = target.dataset.tooltipType,
|
||||
handler = this.types[type];
|
||||
|
||||
if ( handler && handler.onShow )
|
||||
handler.onShow(target, tip);
|
||||
}
|
||||
|
||||
delegateOnHide(target, tip) {
|
||||
const type = target.dataset.tooltipType,
|
||||
handler = this.types[type];
|
||||
|
||||
if ( handler && handler.onHide )
|
||||
handler.onHide(target, tip);
|
||||
}
|
||||
|
||||
checkDelayShow(target, tip) {
|
||||
const type = target.dataset.tooltipType,
|
||||
handler = this.types[type];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue