Remove Handler.MouseWheel mozilla workaround.

This workaround was created because of a mozilla bug [1] with
clientX, clientY on wheel events (DOMMouseScroll).

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=352179
This commit is contained in:
fredj
2011-09-23 17:57:27 +02:00
committed by Frederic Junod
parent c673dbf9f2
commit 2bcd904df6

View File

@@ -21,14 +21,6 @@ OpenLayers.Handler.MouseWheel = OpenLayers.Class(OpenLayers.Handler, {
*/
wheelListener: null,
/**
* Property: mousePosition
* {<OpenLayers.Pixel>} mousePosition is necessary because
* evt.clientX/Y is buggy in Moz on wheel events, so we cache and use the
* value from the last mousemove.
*/
mousePosition: null,
/**
* Property: interval
* {Integer} In order to increase server performance, an interval (in
@@ -208,23 +200,7 @@ OpenLayers.Handler.MouseWheel = OpenLayers.Class(OpenLayers.Handler, {
this.delta = 0;
if (delta) {
// add the mouse position to the event because mozilla has
// a bug with clientX and clientY (see
// https://bugzilla.mozilla.org/show_bug.cgi?id=352179)
// getLonLatFromViewPortPx(e) returns wrong values
if (this.mousePosition) {
e.xy = this.mousePosition;
}
if (!e.xy) {
// If the mouse hasn't moved over the map yet, then
// we don't have a mouse position (in FF), so we just
// act as if the mouse was at the center of the map.
// Note that we can tell we are in the map -- and
// this.map is ensured to be true above.
e.xy = this.map.getPixelFromLonLat(
this.map.getCenter()
);
}
e.xy = this.map.events.getMousePosition(e);
if (delta < 0) {
this.callback("down", [e, this.cumulative ? delta : -1]);
} else {
@@ -233,20 +209,6 @@ OpenLayers.Handler.MouseWheel = OpenLayers.Class(OpenLayers.Handler, {
}
},
/**
* Method: mousemove
* Update the stored mousePosition on every move.
*
* Parameters:
* evt - {Event} The browser event
*
* Returns:
* {Boolean} Allow event propagation
*/
mousemove: function (evt) {
this.mousePosition = evt.xy;
},
/**
* Method: activate
*/