Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #7468 - Cleared all highlights when find bar is closed #7501

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions web/pdf_find_bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ var PDFFindBar = (function PDFFindBarClosure() {
this.toggleButton.classList.remove('toggled');
this.bar.classList.add('hidden');
this.findController.active = false;
//Wipe out all highlighted matches on close
var numPages = this.findController.pdfViewer.pagesCount;
for (var i = 0; i < numPages; i++) {
var page = this.findController.pdfViewer.getPageView(i);
if (page.textLayer) {
page.textLayer.updateMatches();
}
}
},

toggle: function PDFFindBar_toggle() {
Expand Down
2 changes: 1 addition & 1 deletion web/pdf_find_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ var PDFFindController = (function PDFFindControllerClosure() {
if (this.selected.pageIdx === index) {
// If the page is selected, scroll the page into view, which triggers
// rendering the page, which adds the textLayer. Once the textLayer is
// build, it will scroll onto the selected match.
// built, it will scroll onto the selected match.
this.pdfViewer.scrollPageIntoView(index + 1);
}

Expand Down