From bc282b4a588c6127d9161358b1401251f1b0c983 Mon Sep 17 00:00:00 2001 From: Oleg Sh Date: Sun, 30 Jan 2022 17:01:44 +0200 Subject: [PATCH] Hide yandex adv in fullscreen. --- script/main.js | 12 ++++++++---- tpl/home.php | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/script/main.js b/script/main.js index 1440f7e..df2f028 100644 --- a/script/main.js +++ b/script/main.js @@ -585,17 +585,21 @@ function postLoadPage() document.getElementById('Fullscreen').onclick = function() { - var idList = ["h1Header", "h1Text", "navigation", "footerContent"]; + var idList = ["h1Header", "h1Text", "navigation", "footerContent", "bottom_adv"]; fullscreen = !fullscreen userAction(fullscreen ? "fullscreen_on" : "fullscreen_off"); - for (var i = 0; i < idList.length; i++) + for (var i = 0; i < idList.length; i++) { + let element = document.getElementById(idList[i]); + if (!element) continue; + if (fullscreen) - document.getElementById(idList[i]).style.display = "none"; + element.style.display = "none"; else - document.getElementById(idList[i]).style.display = "block"; + element.style.display = "block"; + } document.getElementById("mainContainer").className = fullscreen ? "container-fluid page-wrap" : "container page-wrap"; diff --git a/tpl/home.php b/tpl/home.php index 1b227e7..35fac97 100755 --- a/tpl/home.php +++ b/tpl/home.php @@ -183,10 +183,11 @@ - +
-
+ +
+