From f87da16274356d71d59193e00a324e8901a92c7e Mon Sep 17 00:00:00 2001 From: Georgy Malkov Date: Thu, 21 Sep 2023 11:48:03 +0300 Subject: [PATCH] fix: fix fullscreen button --- scripts/post-build.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/post-build.js b/scripts/post-build.js index 6bc3c54..ef336c9 100644 --- a/scripts/post-build.js +++ b/scripts/post-build.js @@ -101,10 +101,13 @@ const SCRIPT_FIX = ` if(sessionStorage.fullScreen === 'true'){ document.querySelector('.dl-header').style.display = 'none' } -document.querySelector('.dc-controls.dc-controls_vertical button:first-child').addEventListener('click',()=>{ - const header = document.querySelector('.dl-header') - header.style.display = sessionStorage.fullScreen === 'true' ? '' : 'none'; -}) +const fullScreenButton = document.querySelector('.dc-controls.dc-controls_vertical button:first-child') +if(fullScreenButton){ + fullScreenButton.addEventListener('click',()=>{ + const header = document.querySelector('.dl-header') + header.style.display = sessionStorage.fullScreen === 'true' ? '' : 'none'; + }) +} ` async function main() {