Merge all changes from the naturaldocs sandbox. This brings all the work that
has been done in the NaturalDocs branch back to trunk. Thanks to everyone who helped out in making this happen. (I could list people, but the list would be long, and I'm already mentally on vacation.) git-svn-id: http://svn.openlayers.org/trunk/openlayers@3545 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -3,33 +3,40 @@
|
||||
* for the full text of the license. */
|
||||
|
||||
/**
|
||||
* @requires OpenLayers/Handler.js
|
||||
*
|
||||
* Class: OpenLayers.Handler.MouseWheel
|
||||
* Handler for wheel up/down events.
|
||||
*
|
||||
* @class
|
||||
* @requires OpenLayers/Handler.js
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Handler>
|
||||
*/
|
||||
OpenLayers.Handler.MouseWheel = OpenLayers.Class.create();
|
||||
OpenLayers.Handler.MouseWheel.prototype = OpenLayers.Class.inherit( OpenLayers.Handler, {
|
||||
/** @type function **/
|
||||
/**
|
||||
* Property: wheelListener
|
||||
* {function}
|
||||
*/
|
||||
wheelListener: null,
|
||||
|
||||
/** @type OpenLayers.Pixel
|
||||
* @private
|
||||
*
|
||||
* 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.
|
||||
**/
|
||||
/**
|
||||
* Property: mousePosition
|
||||
* *Private*. {<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,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* Constructor: OpenLayers.Handler.MouseWheel
|
||||
*
|
||||
* @param {OpenLayers.Control} control
|
||||
* @param {Object} callbacks An object containing a single function to be
|
||||
* Parameters:
|
||||
* control - {<OpenLayers.Control>}
|
||||
* callbacks - {Object} An object containing a single function to be
|
||||
* called when the drag operation is finished.
|
||||
* The callback should expect to recieve a single
|
||||
* argument, the point geometry.
|
||||
* @param {Object} options
|
||||
* options - {Object}
|
||||
*/
|
||||
initialize: function(control, callbacks, options) {
|
||||
OpenLayers.Handler.prototype.initialize.apply(this, arguments);
|
||||
@@ -37,7 +44,7 @@ OpenLayers.Handler.MouseWheel.prototype = OpenLayers.Class.inherit( OpenLayers.H
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* Method: destroy
|
||||
*/
|
||||
destroy: function() {
|
||||
this.deactivate();
|
||||
@@ -49,9 +56,12 @@ OpenLayers.Handler.MouseWheel.prototype = OpenLayers.Class.inherit( OpenLayers.H
|
||||
* Mouse ScrollWheel code thanks to http://adomas.org/javascript-mouse-wheel/
|
||||
*/
|
||||
|
||||
/** Catch the wheel event and handle it xbrowserly
|
||||
/**
|
||||
* Method: onWheelEvent
|
||||
* Catch the wheel event and handle it xbrowserly
|
||||
*
|
||||
* @param {Event} e
|
||||
* Parameters:
|
||||
* e - {Event}
|
||||
*/
|
||||
onWheelEvent: function(e){
|
||||
// first check keyboard modifiers
|
||||
@@ -98,10 +108,23 @@ OpenLayers.Handler.MouseWheel.prototype = OpenLayers.Class.inherit( OpenLayers.H
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: mousemove
|
||||
* Update the stored mousePosition on every move.
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event} The browser event
|
||||
*
|
||||
* Return:
|
||||
* {Boolean} Allow event propagation
|
||||
*/
|
||||
mousemove: function (evt) {
|
||||
this.mousePosition = evt.xy;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: activate
|
||||
*/
|
||||
activate: function (evt) {
|
||||
if (OpenLayers.Handler.prototype.activate.apply(this, arguments)) {
|
||||
//register mousewheel events specifically on the window and document
|
||||
@@ -115,6 +138,9 @@ OpenLayers.Handler.MouseWheel.prototype = OpenLayers.Class.inherit( OpenLayers.H
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: deactivate
|
||||
*/
|
||||
deactivate: function (evt) {
|
||||
if (OpenLayers.Handler.prototype.deactivate.apply(this, arguments)) {
|
||||
// unregister mousewheel events specifically on the window and document
|
||||
|
||||
Reference in New Issue
Block a user