Fix find in article bar not showing #732 (#733)

This commit is contained in:
Jaifroid 2025-06-19 09:59:14 +01:00 committed by GitHub
parent ae99e20e6c
commit 46e47e792b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View File

@ -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%);

View File

@ -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++) {