Fix repeated login and forwarding alerts; add detached fullscreen controls
This commit is contained in:
1 parent
c98c67e18b
commit
0668a73d40
6 files changed
+37
-6
No files matched your search
@@ -57,6 +57,12 @@
|
||||
for(const [id,label]of Object.entries(labels)){
|
||||
const section=document.getElementById(id);if(!section)continue;
|
||||
const heading=section.querySelector('.terminal-actions,.monitor-heading>div,.chat-actions,.page-heading');
|
||||
if(view===id&&heading){
|
||||
const fullscreen=document.createElement('button');fullscreen.type='button';fullscreen.className='secondary detach-button';
|
||||
const update=()=>{const active=!!document.fullscreenElement;fullscreen.textContent=(active?'⊡ ':'⛶ ')+BPQI18n.t(active?'Torna alla finestra':'Schermo intero');fullscreen.setAttribute('aria-pressed',String(active));};
|
||||
fullscreen.onclick=async()=>{try{if(document.fullscreenElement)await document.exitFullscreen();else await document.documentElement.requestFullscreen();}catch{if(typeof toast==='function')toast(BPQI18n.t('Schermo intero non disponibile in questo browser. Prova F11.'));}};
|
||||
document.addEventListener('fullscreenchange',update);update();heading.append(fullscreen);
|
||||
}
|
||||
if(id!=='terminal'&&heading){
|
||||
const button=document.createElement('button');button.type='button';button.className='secondary detach-button';button.dataset.detach=id;
|
||||
button.textContent=view===id?'↙ Torna al pannello':'↗ Stacca';button.onclick=()=>view===id?dock(id):open(id);heading.append(button);
|
||||
|
||||
Reference in new issue
Block a user