3
Copyright 2012 Yahoo! Inc. All rights reserved.
4
Licensed under the BSD License.
5
http://yuilibrary.com/license/
7
YUI.add('event-mousewheel', function(Y) {
10
* Adds mousewheel event support
12
* @submodule event-mousewheel
14
var DOM_MOUSE_SCROLL = 'DOMMouseScroll',
15
fixArgs = function(args) {
16
var a = Y.Array(args, 0, true), target;
18
a[0] = DOM_MOUSE_SCROLL;
19
target = Y.config.win;
21
target = Y.config.doc;
27
a.splice(2, 0, target);
34
* Mousewheel event. This listener is automatically attached to the
35
* correct target, so one should not be supplied. Mouse wheel
36
* direction and velocity is stored in the 'wheelDelta' field.
38
* @param type {string} 'mousewheel'
39
* @param fn {function} the callback to execute
40
* @param context optional context object
41
* @param args 0..n additional arguments to provide to the listener.
42
* @return {EventHandle} the detach handle
45
Y.Env.evt.plugins.mousewheel = {
47
return Y.Event._attach(fixArgs(arguments));
51
return Y.Event.detach.apply(Y.Event, fixArgs(arguments));
56
}, '3.5.0' ,{requires:['node-base']});