mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-10-18 17:02:00 +00:00
Exclusive settings mode / pop-out (#399)
- In exclusive mode, the settings menu isn't minimizable or closable - It automatically opens in said mode when it finds `?ffz-settings` in the URL - When in pop-out chat, the FrankerFaceZ Control Center link will open a new window with exclusive settings mode.
This commit is contained in:
parent
2e5c99c727
commit
19c81bb049
5 changed files with 34 additions and 7 deletions
|
@ -61,6 +61,15 @@ export default class Twilight extends BaseSite {
|
|||
rel: 'stylesheet',
|
||||
type: 'text/css'
|
||||
}));
|
||||
|
||||
// Check for ?ffz-settings in page and open the
|
||||
// settings window in exclusive mode.
|
||||
const params = new URL(window.location).searchParams;
|
||||
if (params && params.has('ffz-settings')) {
|
||||
const main_menu = this.resolve('main_menu');
|
||||
main_menu.exclusive = true;
|
||||
main_menu.enable();
|
||||
}
|
||||
}
|
||||
|
||||
updateContext() {
|
||||
|
|
|
@ -56,7 +56,18 @@ export default class SettingsMenu extends Module {
|
|||
}
|
||||
|
||||
click(inst) {
|
||||
this.emit('site.menu_button:clicked');
|
||||
// Pop-out chat check
|
||||
const twMinimalRoot = document.querySelector('.twilight-minimal-root');
|
||||
if (twMinimalRoot) {
|
||||
const win = window.open(
|
||||
'https://twitch.tv/frankerfacez?ffz-settings',
|
||||
'_blank',
|
||||
'resizable=yes,scrollbars=yes,width=800,height=600'
|
||||
);
|
||||
win.focus();
|
||||
} else {
|
||||
this.emit('site.menu_button:clicked');
|
||||
}
|
||||
const parent = this.fine.searchParent(inst, n => n.toggleBalloonId);
|
||||
parent && parent.handleButtonClick();
|
||||
}
|
||||
|
|
|
@ -35,6 +35,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
&.exclusive {
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.want-ps {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue