Introduced setupViewer()

This commit is contained in:
Veloman Yunkan 2022-09-04 15:05:03 +04:00
parent da23e4eca4
commit ae01790375
2 changed files with 9 additions and 3 deletions

View File

@ -312,7 +312,7 @@ function setupAutoHidingOfTheToolbar() {
} }
document.addEventListener('DOMContentLoaded', function () { function setupSuggestions() {
const kiwixSearchBox = document.querySelector('#kiwixsearchbox'); const kiwixSearchBox = document.querySelector('#kiwixsearchbox');
const kiwixSearchFormWrapper = document.querySelector('.kiwix_searchform'); 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('label[for="kiwix_button_show_toggle"]').classList.remove('searching');
document.querySelector('.kiwix_button_cont').classList.remove('searching'); document.querySelector('.kiwix_button_cont').classList.remove('searching');
}); });
}
function setupViewer() {
handle_visual_viewport_change();
setupSuggestions();
// cybook hack // cybook hack
if (navigator.userAgent.indexOf("bookeen/cybook") != -1) { if (navigator.userAgent.indexOf("bookeen/cybook") != -1) {
@ -391,4 +397,4 @@ document.addEventListener('DOMContentLoaded', function () {
if (document.body.clientWidth < 520) { if (document.body.clientWidth < 520) {
setupAutoHidingOfTheToolbar(); setupAutoHidingOfTheToolbar();
} }
}); }

View File

@ -24,7 +24,7 @@
</script> </script>
</head> </head>
<body style="margin:0" onload="handle_visual_viewport_change()"> <body style="margin:0" onload="setupViewer()">
<span class="kiwix"> <span class="kiwix">
<span id="kiwixtoolbar" class="ui-widget-header"> <span id="kiwixtoolbar" class="ui-widget-header">
<div class="kiwix_centered"> <div class="kiwix_centered">