Browse Source

bug fix: textLayer ready still needs scroll

Artur Adib 13 years ago
parent
commit
3bd20a7415
  1. 8
      web/viewer.js

8
web/viewer.js

@ -323,14 +323,16 @@ var PDFFindController = {
updatePage: function(idx) { updatePage: function(idx) {
var page = PDFView.pages[idx]; var page = PDFView.pages[idx];
if (page.textLayer) { if (this.selected.pageIdx === idx) {
page.textLayer.updateMatches();
} else if (this.selected.pageIdx === idx) {
// If the page is selected, scroll the page into view, which triggers // If the page is selected, scroll the page into view, which triggers
// rendering the page, which adds the textLayer. Once the textLayer is // rendering the page, which adds the textLayer. Once the textLayer is
// build, it will scroll onto the selected match. // build, it will scroll onto the selected match.
page.scrollIntoView(); page.scrollIntoView();
} }
if (page.textLayer) {
page.textLayer.updateMatches();
}
}, },
performFind: function() { performFind: function() {

Loading…
Cancel
Save