Refactors PDFFindBar and FirefoxCom find events.
This commit is contained in:
parent
7fd3db9977
commit
3e6e294fd4
4 changed files with 48 additions and 19 deletions
|
@ -148,6 +148,32 @@ Preferences._readFromStorage = function (prefObj) {
|
|||
});
|
||||
};
|
||||
|
||||
(function listenFindEvents() {
|
||||
var events = [
|
||||
'find',
|
||||
'findagain',
|
||||
'findhighlightallchange',
|
||||
'findcasesensitivitychange'
|
||||
];
|
||||
var handleEvent = function (evt) {
|
||||
if (!PDFViewerApplication.initialized) {
|
||||
return;
|
||||
}
|
||||
PDFViewerApplication.eventBus.dispatch('find', {
|
||||
source: window,
|
||||
type: evt.type.substring('find'.length),
|
||||
query: evt.detail.query,
|
||||
caseSensitive: !!evt.detail.caseSensitive,
|
||||
highlightAll: !!evt.detail.highlightAll,
|
||||
findPrevious: !!evt.detail.findPrevious
|
||||
});
|
||||
}.bind(this);
|
||||
|
||||
for (var i = 0, len = events.length; i < len; i++) {
|
||||
window.addEventListener(events[i], handleEvent);
|
||||
}
|
||||
})();
|
||||
|
||||
function FirefoxComDataRangeTransport(length, initialData) {
|
||||
pdfjsLib.PDFDataRangeTransport.call(this, length, initialData);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue