diff --git a/www/css/app.css b/www/css/app.css index cc18cf2f..2fd96241 100644 --- a/www/css/app.css +++ b/www/css/app.css @@ -354,7 +354,6 @@ div:not(.panel-success, .alert-message) { .navbar { min-height: 0px !important; - height: 45px; left: env(titlebar-area-x, 0); top: env(titlebar-area-y, 0); width: env(titlebar-area-width, 100%); diff --git a/www/js/app.js b/www/js/app.js index dbaa221b..ed2144d3 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -564,6 +564,8 @@ function clearFindInArticle () { document.getElementById('findText').addEventListener('click', function () { var searchDiv = document.getElementById('row2'); if (searchDiv.style.display !== 'none') { + // Hide the search bar + setNavbarHeight(params.navbarHeight, params.relativeUIFontSize); setTab(); // Return sections to original state openAllSections(); @@ -571,6 +573,8 @@ document.getElementById('findText').addEventListener('click', function () { checkToolbar(); return; } + // Set the height of the navbar to accommodate the search bar + setNavbarHeight(params.navbarHeight + 35, params.relativeUIFontSize); var findInArticle = null; var innerDocument = document.getElementById('articleContent').contentDocument; if (appstate.isReplayWorkerAvailable) { @@ -756,12 +760,18 @@ document.getElementById('relativeUIFontSizeSlider').addEventListener('change', f setRelativeUIFontSize(this.value); }); +// Helper function to calculate navbar height +function setNavbarHeight(height, relativeUIFontSize) { + const navbar = document.getElementById('navbar'); + navbar.style.height = height * (relativeUIFontSize / 100) + 'px'; +} + function setRelativeUIFontSize (value) { value = ~~value; document.getElementById('spinnerVal').innerHTML = value + '%'; document.getElementById('search-article').style.fontSize = value + '%'; document.getElementById('relativeUIFontSizeSlider').value = value; - document.getElementById('navbar').style.height = params.navbarHeight * (value / 100) + 'px'; + setNavbarHeight(params.navbarHeight, value); var forms = document.querySelectorAll('.form-control'); var i; for (i = 0; i < forms.length; i++) {