Bug 499277: Once unzoomed, dblClick can throw an error - aElement is null, r=mfinkle

This commit is contained in:
Vivien Nicolas 2009-06-19 11:35:41 -04:00
parent 7ffd78b491
commit d8a0e703b2

View File

@ -718,7 +718,7 @@ function ContentClickingModule(owner) {
this._owner = owner;
this._clickTimeout = -1;
this._events = [];
this._zoomed = false;
this._zoomedTo = null;
}
ContentClickingModule.prototype = {
@ -798,12 +798,14 @@ ContentClickingModule.prototype = {
let firstEvent = this._events[0].event;
let zoomElement = optimalElementForPoint(firstEvent.clientX, firstEvent.clientY);
if (zoomElement != this._zoomedTo) {
this._zoomedTo = zoomElement;
Browser.canvasBrowser.zoomToElement(zoomElement);
} else {
this._zoomedTo = null;
Browser.canvasBrowser.zoomFromElement(zoomElement);
if (zoomElement) {
if (zoomElement != this._zoomedTo) {
this._zoomedTo = zoomElement;
Browser.canvasBrowser.zoomToElement(zoomElement);
} else {
this._zoomedTo = null;
Browser.canvasBrowser.zoomFromElement(zoomElement);
}
}
this._owner.ungrab(this);