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:
Jonas Jenwald 2018-09-22 15:31:33 +02:00
parent 1eaa3b8a08
commit f29b4d1116
4 changed files with 39 additions and 11 deletions

View file

@ -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);
}
/**