1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-16 01:56:55 +00:00

Added: Ability to hide re-runs in sidebar channel lists (#687)

This commit is contained in:
1bakedpotato 2019-10-23 17:49:01 -05:00 committed by Mike
parent 903b0b234c
commit 3e653c0381
2 changed files with 34 additions and 0 deletions

View file

@ -35,6 +35,11 @@ export default class Layout extends Module {
n => n.getPopularChannels && n.props && has(n.props, 'locale')
);
this.SideBarChannels = this.fine.define(
'nav-cards',
t => t.getCardSlideInContent && t.props && has(t.props, 'tooltipContent')
);
this.settings.add('layout.portrait', {
default: false,
ui: {
@ -179,6 +184,14 @@ export default class Layout extends Module {
this.PopularChannels.on('mount', this.updatePopular, this);
this.PopularChannels.on('update', this.updatePopular, this);
this.SideBarChannels.ready((cls, instances) => {
for(const inst of instances)
this.updateCardClass(inst);
});
this.SideBarChannels.on('mount', this.updateCardClass, this);
this.SideBarChannels.on('update', this.updateCardClass, this);
const t = this;
this.RightColumn.ready((cls, instances) => {
cls.prototype.ffzHideOnBreakpoint = function() {
@ -229,6 +242,15 @@ export default class Layout extends Module {
return this.settings.get('layout.is-minimal')
}
updateCardClass(inst) {
const node = this.fine.getChildNode(inst);
if ( node )
node.classList.toggle('ffz--side-nav-card-rerun',
inst.props?.tooltipContent?.props?.streamType === 'rerun'
);
}
updateNavLinks() {
for(const inst of this.TopNav.instances)
try {