Implement Exit Fullscreen using same button

This commit is contained in:
Isaac Connor 2021-11-10 14:22:05 -05:00
parent a7fd65d844
commit 14e578cdb2
2 changed files with 17 additions and 3 deletions

View File

@ -971,8 +971,18 @@ function initPage() {
} // initPage } // initPage
function watchFullscreen() { function watchFullscreen() {
const btn = document.getElementById('fullscreenBtn');
console.log(btn);
if (btn.firstElementChild.innerHTML=='fullscreen') {
const content = document.getElementById('content'); const content = document.getElementById('content');
openFullscreen(content); openFullscreen(content);
btn.firstElementChild.innerHTML='fullscreen_exit';
btn.setAttribute('title', translate["Exit Fullscreen"]);
} else {
closeFullscreen();
btn.firstElementChild.innerHTML='fullscreen';
btn.setAttribute('title', translate["Fullscreen"]);
}
} }
// Kick everything off // Kick everything off

View File

@ -97,9 +97,13 @@ foreach( dbFetchAll( 'SELECT * FROM ControlPresets WHERE MonitorId = ?', NULL, a
$labels[$row['Preset']] = $row['Label']; $labels[$row['Preset']] = $row['Label'];
} }
foreach ( $labels as $index=>$label ) { foreach ($labels as $index=>$label) {
?> ?>
labels[<?php echo validInt($index) ?>] = '<?php echo validJsStr($label) ?>'; labels[<?php echo validInt($index) ?>] = '<?php echo validJsStr($label) ?>';
<?php <?php
} }
?> ?>
var translate = {
"Fullscreen": "<?php echo translate('Fullscreen') ?>",
"Exit Fullscreen": "<?php echo translate('Exit Fullscreen') ?>",
};