mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Clear all find highlights when the findbar is closed (issue 7468)
Please note that this will require a `mozilla-central` follow-up patch, in order for this to work in the built-in Firefox PDF viewer as well.
This commit is contained in:
parent
1eaa3b8a08
commit
f29b4d1116
4 changed files with 39 additions and 11 deletions
|
@ -317,7 +317,7 @@ class TextLayerBuilder {
|
|||
clearedUntilDivIdx = match.end.divIdx + 1;
|
||||
}
|
||||
|
||||
if (this.findController === null || !this.findController.active) {
|
||||
if (!this.findController || !this.findController.highlightMatches) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -357,8 +357,15 @@ class TextLayerBuilder {
|
|||
delete _boundEvents[name];
|
||||
}
|
||||
};
|
||||
_boundEvents.updateTextLayerMatches = (evt) => {
|
||||
if (evt.pageIndex !== -1) {
|
||||
return;
|
||||
}
|
||||
this.updateMatches();
|
||||
};
|
||||
|
||||
eventBus.on('pagecancelled', _boundEvents.pageCancelled);
|
||||
eventBus.on('updatetextlayermatches', _boundEvents.updateTextLayerMatches);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue