From c7a44391cfd47210a574291e7a316934e706f37a Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 26 Feb 2016 18:22:08 +0100 Subject: [PATCH] Add a `reset` method to `PDFFindbar`, and use it to clear parts of the find UI when the document is closed --- web/pdf_find_bar.js | 4 ++++ web/viewer.js | 1 + 2 files changed, 5 insertions(+) diff --git a/web/pdf_find_bar.js b/web/pdf_find_bar.js index 7fddd5d8f..ffcbef719 100644 --- a/web/pdf_find_bar.js +++ b/web/pdf_find_bar.js @@ -83,6 +83,10 @@ var PDFFindBar = (function PDFFindBarClosure() { } PDFFindBar.prototype = { + reset: function PDFFindBar_reset() { + this.updateUIState(); + }, + dispatchEvent: function PDFFindBar_dispatchEvent(type, findPrev) { var event = document.createEvent('CustomEvent'); event.initCustomEvent('find' + type, true, true, { diff --git a/web/viewer.js b/web/viewer.js index ee248cc2e..f2567fcae 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -527,6 +527,7 @@ var PDFViewerApplication = { } this.findController.reset(); + this.findBar.reset(); if (typeof PDFBug !== 'undefined') { PDFBug.cleanup();