Merge pull request #2258 from brendandahl/mc-review-0.6.2
Addresses review feedback from mc bug 801280.
This commit is contained in:
commit
7252583641
@ -467,12 +467,13 @@ function FindEventManager(eventElement, contentWindow, chromeWindow) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FindEventManager.prototype.bind = function() {
|
FindEventManager.prototype.bind = function() {
|
||||||
this.contentWindow.addEventListener('unload', function unload(e) {
|
var unload = function(e) {
|
||||||
this.unbind();
|
this.unbind();
|
||||||
this.contentWindow.removeEventListener(e.type, unload);
|
this.contentWindow.removeEventListener(e.type, unload);
|
||||||
}.bind(this));
|
}.bind(this);
|
||||||
|
this.contentWindow.addEventListener('unload', unload);
|
||||||
|
|
||||||
for (var i = 0, ii = this.types.length; i < ii; ++i) {
|
for (var i = 0; i < this.types.length; i++) {
|
||||||
var type = this.types[i];
|
var type = this.types[i];
|
||||||
this.eventElement.addEventListener(type, this, true);
|
this.eventElement.addEventListener(type, this, true);
|
||||||
}
|
}
|
||||||
@ -498,7 +499,7 @@ FindEventManager.prototype.handleEvent = function(e) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
FindEventManager.prototype.unbind = function() {
|
FindEventManager.prototype.unbind = function() {
|
||||||
for (var i = 0, ii = this.types.length; i < ii; ++i) {
|
for (var i = 0; i < this.types.length; i++) {
|
||||||
var type = this.types[i];
|
var type = this.types[i];
|
||||||
this.eventElement.removeEventListener(type, this, true);
|
this.eventElement.removeEventListener(type, this, true);
|
||||||
}
|
}
|
||||||
@ -616,11 +617,13 @@ PdfStreamConverter.prototype = {
|
|||||||
domWindow.addEventListener(PDFJS_EVENT_ID, function(event) {
|
domWindow.addEventListener(PDFJS_EVENT_ID, function(event) {
|
||||||
requestListener.receive(event);
|
requestListener.receive(event);
|
||||||
}, false, true);
|
}, false, true);
|
||||||
var chromeWindow = getChromeWindow(domWindow);
|
if (actions.supportsIntegratedFind()) {
|
||||||
var findEventManager = new FindEventManager(chromeWindow.gFindBar,
|
var chromeWindow = getChromeWindow(domWindow);
|
||||||
domWindow,
|
var findEventManager = new FindEventManager(chromeWindow.gFindBar,
|
||||||
chromeWindow);
|
domWindow,
|
||||||
findEventManager.bind();
|
chromeWindow);
|
||||||
|
findEventManager.bind();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
listener.onStopRequest.apply(listener, arguments);
|
listener.onStopRequest.apply(listener, arguments);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user