mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-11 00:20:54 +00:00
4.20.11
* Added: Setting to disable Channel Hosting. * Added: Setting to hide streams tagged as Promoted from the directory. * Fixed: Tool-tips not appearing when an element is open in fullscreen. * Fixed: Bug when destroying a tool-tip instance. * Fixed: Directory cards not updating with FFZ features on the front page. * API Added: `Subpump` module for manipulating Twitch PubSub events. * API Changed: Add-Ons can now define custom settings profile filters.
This commit is contained in:
parent
ced61d2bfc
commit
22c60050e0
17 changed files with 356 additions and 96 deletions
|
@ -334,7 +334,7 @@ export default class Actions extends Module {
|
|||
target._ffz_destroy = target._ffz_outside = target._ffz_on_destroy = null;
|
||||
}
|
||||
|
||||
const parent = document.body.querySelector('#root>div') || document.body,
|
||||
const parent = document.fullscreenElement || document.body.querySelector('#root>div') || document.body,
|
||||
tt = target._ffz_popup = new Tooltip(parent, target, {
|
||||
logger: this.log,
|
||||
manual: true,
|
||||
|
@ -807,8 +807,8 @@ export default class Actions extends Module {
|
|||
return this.log.warn(`No click handler for action provider "${data.action}"`);
|
||||
}
|
||||
|
||||
if ( target._ffz_tooltip$0 )
|
||||
target._ffz_tooltip$0.hide();
|
||||
if ( target._ffz_tooltip )
|
||||
target._ffz_tooltip.hide();
|
||||
|
||||
return data.definition.click.call(this, event, data);
|
||||
}
|
||||
|
@ -827,8 +827,8 @@ export default class Actions extends Module {
|
|||
if ( target.classList.contains('disabled') )
|
||||
return;
|
||||
|
||||
if ( target._ffz_tooltip$0 )
|
||||
target._ffz_tooltip$0.hide();
|
||||
if ( target._ffz_tooltip )
|
||||
target._ffz_tooltip.hide();
|
||||
|
||||
if ( ! data.definition.context && ! data.definition.uses_reason )
|
||||
return;
|
||||
|
@ -847,8 +847,8 @@ export default class Actions extends Module {
|
|||
event.preventDefault();
|
||||
|
||||
const target = event.target;
|
||||
if ( target._ffz_tooltip$0 )
|
||||
target._ffz_tooltip$0.hide();
|
||||
if ( target._ffz_tooltip )
|
||||
target._ffz_tooltip.hide();
|
||||
|
||||
this.renderUserContext(target, actions);
|
||||
}
|
||||
|
|
|
@ -386,7 +386,7 @@ export default class Emotes extends Module {
|
|||
return;
|
||||
|
||||
this.toggleFavorite(source, id);
|
||||
const tt = target._ffz_tooltip$0;
|
||||
const tt = target._ffz_tooltip;
|
||||
if ( tt && tt.visible ) {
|
||||
tt.hide();
|
||||
setTimeout(() => document.contains(target) && tt.show(), 0);
|
||||
|
|
|
@ -56,7 +56,7 @@ export default class Overrides extends Module {
|
|||
v.$destroy();
|
||||
}
|
||||
|
||||
const parent = document.body.querySelector('#root>div') || document.body;
|
||||
const parent = document.fullscreenElement || document.body.querySelector('#root>div') || document.body;
|
||||
|
||||
popup = new Tooltip(parent, [], {
|
||||
logger: this.log,
|
||||
|
|
|
@ -144,8 +144,10 @@ export default {
|
|||
props: ['item', 'context'],
|
||||
|
||||
data() {
|
||||
const settings = this.context.getFFZ().resolve('settings');
|
||||
|
||||
return {
|
||||
filters: deep_copy(require('src/settings/filters.js')),
|
||||
filters: deep_copy(settings.filters),
|
||||
|
||||
old_name: null,
|
||||
old_desc: null,
|
||||
|
|
|
@ -59,16 +59,30 @@ export default class TooltipProvider extends Module {
|
|||
|
||||
this.types.text = target => sanitize(target.dataset.title);
|
||||
this.types.html = target => target.dataset.title;
|
||||
|
||||
this.onFSChange = this.onFSChange.bind(this);
|
||||
}
|
||||
|
||||
onEnable() {
|
||||
const container = document.querySelector('.sunlight-root') || document.querySelector('#root>div') || document.querySelector('#root') || document.querySelector('.clips-root') || document.body;
|
||||
|
||||
window.addEventListener('fullscreenchange', this.onFSChange);
|
||||
|
||||
// is_minimal = false; //container && container.classList.contains('twilight-minimal-root');
|
||||
|
||||
this.tips = new Tooltip(container, 'ffz-tooltip', {
|
||||
this.container = container;
|
||||
this.tip_element = container;
|
||||
this.tips = this._createInstance(container);
|
||||
|
||||
this.on(':cleanup', this.cleanup);
|
||||
}
|
||||
|
||||
|
||||
_createInstance(container) {
|
||||
return new Tooltip(container, 'ffz-tooltip', {
|
||||
html: true,
|
||||
i18n: this.i18n,
|
||||
live: true,
|
||||
|
||||
delayHide: this.checkDelayHide.bind(this),
|
||||
delayShow: this.checkDelayShow.bind(this),
|
||||
|
@ -99,10 +113,20 @@ export default class TooltipProvider extends Module {
|
|||
this.emit(':leave', target, tip, event);
|
||||
}
|
||||
});
|
||||
|
||||
this.on(':cleanup', this.cleanup);
|
||||
}
|
||||
|
||||
|
||||
|
||||
onFSChange() {
|
||||
const tip_element = document.fullscreenElement || this.container;
|
||||
if ( tip_element !== this.tip_element ) {
|
||||
this.tips.destroy();
|
||||
this.tip_element = tip_element;
|
||||
this.tips = this._createInstance(tip_element);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cleanup() {
|
||||
this.tips.cleanup();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue