bug fix: clear previous highlights
This commit is contained in:
parent
6022476f03
commit
73b96e0e58
@ -2365,6 +2365,18 @@ var TextLayerBuilder = function textLayerBuilder(textLayerDiv, pageIdx) {
|
|||||||
return ret;
|
return ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.clearMatches = function textLayerBuilder_clearMatches() {
|
||||||
|
var textDivs = this.textDivs;
|
||||||
|
|
||||||
|
// Clear all previous highlights
|
||||||
|
textDivs.forEach(function(div) {
|
||||||
|
var spans = div.querySelectorAll('span');
|
||||||
|
for (var i = 0, ii = spans.length; i < ii; i++) {
|
||||||
|
spans[i].className = '';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.renderMatches = function textLayerBuilder_renderMatches(matches) {
|
this.renderMatches = function textLayerBuilder_renderMatches(matches) {
|
||||||
var bidiTexts = this.textContent.bidiTexts;
|
var bidiTexts = this.textContent.bidiTexts;
|
||||||
var textDivs = this.textDivs;
|
var textDivs = this.textDivs;
|
||||||
@ -2372,6 +2384,8 @@ var TextLayerBuilder = function textLayerBuilder(textLayerDiv, pageIdx) {
|
|||||||
var isSelectedPage = this.pageIdx === PDFFindController.selected.pageIdx;
|
var isSelectedPage = this.pageIdx === PDFFindController.selected.pageIdx;
|
||||||
var selectedMatchIdx = PDFFindController.selected.matchIdx;
|
var selectedMatchIdx = PDFFindController.selected.matchIdx;
|
||||||
|
|
||||||
|
this.clearMatches();
|
||||||
|
|
||||||
var infty = {
|
var infty = {
|
||||||
divIdx: -1,
|
divIdx: -1,
|
||||||
offset: undefined
|
offset: undefined
|
||||||
|
Loading…
x
Reference in New Issue
Block a user