Bug 779358 - Fix mousemove event handled twice in content panning, r=cjones

This commit is contained in:
Cervantes Yu 2012-08-21 20:30:34 +08:00
Родитель 5c97dc6e65
Коммит 201d23326e
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -5,7 +5,7 @@
const ContentPanning = {
init: function cp_init() {
['mousedown', 'mouseup', 'mousemove'].forEach(function(type) {
addEventListener(type, ContentPanning, true);
addEventListener(type, ContentPanning, false);
});
addMessageListener("Viewport:Change", this._recvViewportChange.bind(this));
@ -30,7 +30,7 @@ const ContentPanning = {
let target = evt.target;
let view = target.ownerDocument ? target.ownerDocument.defaultView
: target;
view.removeEventListener('click', this, true, true);
view.removeEventListener('click', this, false, true);
break;
}
},
@ -83,7 +83,7 @@ const ContentPanning = {
let target = this.target;
let view = target.ownerDocument ? target.ownerDocument.defaultView
: target;
view.addEventListener('click', this, true, true);
view.addEventListener('click', this, false, true);
}
if (this.panning)
@ -107,6 +107,8 @@ const ContentPanning = {
this.panning = true;
this._resetActive();
}
evt.stopPropagation();
evt.preventDefault();
},