diff --git a/web/images/loading-small.png b/web/images/loading-small.png new file mode 100644 index 000000000..1b2df8093 Binary files /dev/null and b/web/images/loading-small.png differ diff --git a/web/viewer.css b/web/viewer.css index 475703ff0..378516dc9 100644 --- a/web/viewer.css +++ b/web/viewer.css @@ -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; diff --git a/web/viewer.js b/web/viewer.js index cd59983eb..faa0d59a3 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -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;