From ae0179037508cf3e66025b82e678b11edf1c1cdd Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Sun, 4 Sep 2022 15:05:03 +0400 Subject: [PATCH] Introduced setupViewer() --- static/skin/viewer.js | 10 ++++++++-- static/viewer.html | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/static/skin/viewer.js b/static/skin/viewer.js index 326d3c4c3..a8222c5ff 100644 --- a/static/skin/viewer.js +++ b/static/skin/viewer.js @@ -312,7 +312,7 @@ function setupAutoHidingOfTheToolbar() { } -document.addEventListener('DOMContentLoaded', function () { +function setupSuggestions() { const kiwixSearchBox = document.querySelector('#kiwixsearchbox'); const kiwixSearchFormWrapper = document.querySelector('.kiwix_searchform'); @@ -382,6 +382,12 @@ document.addEventListener('DOMContentLoaded', function () { document.querySelector('label[for="kiwix_button_show_toggle"]').classList.remove('searching'); document.querySelector('.kiwix_button_cont').classList.remove('searching'); }); +} + +function setupViewer() { + handle_visual_viewport_change(); + + setupSuggestions(); // cybook hack if (navigator.userAgent.indexOf("bookeen/cybook") != -1) { @@ -391,4 +397,4 @@ document.addEventListener('DOMContentLoaded', function () { if (document.body.clientWidth < 520) { setupAutoHidingOfTheToolbar(); } -}); +} diff --git a/static/viewer.html b/static/viewer.html index 8ddc940e7..c006bcc9b 100644 --- a/static/viewer.html +++ b/static/viewer.html @@ -24,7 +24,7 @@ - +