diff --git a/crates/forge-web/assets/nav.js b/crates/forge-web/assets/nav.js index 16a1c9e..d4e6cb6 100644 --- a/crates/forge-web/assets/nav.js +++ b/crates/forge-web/assets/nav.js @@ -2115,11 +2115,14 @@ pre._ci.hit = -1; } + // Writes the match counter. The previous and next buttons show only while there are matches. function logCount(text, none) { var out = document.querySelector('[data-log-count]'); if (!out) { return; } out.textContent = text; out.classList.toggle('ci-none', !!none); + var bar = out.closest('.ci-logbar'); + if (bar) { bar.classList.toggle('has-hits', !!text && !none); } } // Highlights every match of `q` (case-insensitive) in the log and selects the one at `keep`. diff --git a/style/main.scss b/style/main.scss index 4d8f27e..65f8ef6 100644 --- a/style/main.scss +++ b/style/main.scss @@ -4914,6 +4914,12 @@ button.ci-mini { font-size: 0.8125rem; } +// The log's previous and next match buttons show only while a search has matches. +.ci-logbar:not(.has-hits) [data-log-prev], +.ci-logbar:not(.has-hits) [data-log-next] { + display: none; +} + // The config keys this forge ignored, above the timeline. .ci-warnings { margin: 8px 0 12px;