From cb0009dab43e0f8aaf630fb826159936047a361e Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 5 Jul 2017 11:19:29 +0200 Subject: [PATCH] Actually reset the `findResultsCount` label, in addition to hiding it, when no matches are found Currently we're *only* hiding the label, but not actually resetting it until a new match is found. Obviously it's being hidden, but it seems that it really ought to be completely reset as well (since e.g. `PDFFindBar.reset` won't technically reset *all* state otherwise). --- web/pdf_find_bar.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web/pdf_find_bar.js b/web/pdf_find_bar.js index c1d7132c5..c26546647 100644 --- a/web/pdf_find_bar.js +++ b/web/pdf_find_bar.js @@ -151,15 +151,15 @@ class PDFFindBar { return; // No UI control is provided. } - // If there are no matches, hide the counter. if (!matchCount) { + // If there are no matches, hide and reset the counter. this.findResultsCount.classList.add('hidden'); - return; + this.findResultsCount.textContent = ''; + } else { + // Update and show the match counter. + this.findResultsCount.textContent = matchCount.toLocaleString(); + this.findResultsCount.classList.remove('hidden'); } - - // Create and show the match counter. - this.findResultsCount.textContent = matchCount.toLocaleString(); - this.findResultsCount.classList.remove('hidden'); } open() {