Delay extracting text until first find event.
This commit is contained in:
parent
1c80c610db
commit
c3debc6ee0
BIN
web/images/loading-small.png
Normal file
BIN
web/images/loading-small.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.8 KiB |
@ -295,6 +295,12 @@ html[dir='rtl'] .findbar {
|
||||
-moz-user-select:none;
|
||||
}
|
||||
|
||||
#findInput[status="pending"] {
|
||||
background-image: url(images/loading-small.png);
|
||||
background-repeat: no-repeat;
|
||||
background-position: right;
|
||||
}
|
||||
|
||||
.doorHanger {
|
||||
border: 1px solid hsla(0,0%,0%,.5);
|
||||
border-radius: 2px;
|
||||
|
@ -498,6 +498,7 @@ var PDFFindBar = {
|
||||
this.highlightAll = document.getElementById('findHighlightAll');
|
||||
this.caseSensitive = document.getElementById('findMatchCase');
|
||||
this.findMsg = document.getElementById('findMsg');
|
||||
this.findStatusIcon = document.getElementById('findStatusIcon');
|
||||
|
||||
var self = this;
|
||||
this.toggleButton.addEventListener('click', function() {
|
||||
@ -552,12 +553,16 @@ var PDFFindBar = {
|
||||
updateUIState: function(state, previous) {
|
||||
var notFound = false;
|
||||
var findMsg = '';
|
||||
var status = 'pending';
|
||||
var status = '';
|
||||
|
||||
switch (state) {
|
||||
case FindStates.FIND_FOUND:
|
||||
break;
|
||||
|
||||
case FindStates.FIND_PENDING:
|
||||
status = 'pending';
|
||||
break;
|
||||
|
||||
case FindStates.FIND_NOTFOUND:
|
||||
findMsg = mozL10n.get('find_not_found', null, 'Phrase not found');
|
||||
notFound = true;
|
||||
@ -580,6 +585,7 @@ var PDFFindBar = {
|
||||
this.findField.classList.remove('notFound');
|
||||
}
|
||||
|
||||
this.findField.setAttribute('status', status);
|
||||
this.findMsg.textContent = findMsg;
|
||||
},
|
||||
|
||||
@ -1151,9 +1157,6 @@ var PDFView = {
|
||||
thumbnails.push(thumbnailView);
|
||||
var pageRef = page.ref;
|
||||
pagesRefMap[pageRef.num + ' ' + pageRef.gen + ' R'] = i;
|
||||
|
||||
// Trigger text extraction. TODO: Make this happen lasyliy if needed.
|
||||
PDFFindController.extractText();
|
||||
}
|
||||
|
||||
self.pagesRefMap = pagesRefMap;
|
||||
|
Loading…
x
Reference in New Issue
Block a user