~ubuntu-branches/ubuntu/saucy/whoopsie-daisy/saucy

« back to all changes in this revision

Viewing changes to backend/stats/static/js/yui/build/event-mousewheel/event-mousewheel.js

  • Committer: Package Import Robot
  • Author(s): Evan Dandrea
  • Date: 2012-04-18 13:04:36 UTC
  • Revision ID: package-import@ubuntu.com-20120418130436-vmt93p8fds516lws
Tags: 0.1.32
Fix failing tests on powerpc and ARM.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
YUI 3.5.0 (build 5089)
 
3
Copyright 2012 Yahoo! Inc. All rights reserved.
 
4
Licensed under the BSD License.
 
5
http://yuilibrary.com/license/
 
6
*/
 
7
YUI.add('event-mousewheel', function(Y) {
 
8
 
 
9
/**
 
10
 * Adds mousewheel event support
 
11
 * @module event
 
12
 * @submodule event-mousewheel
 
13
 */
 
14
var DOM_MOUSE_SCROLL = 'DOMMouseScroll',
 
15
    fixArgs = function(args) {
 
16
        var a = Y.Array(args, 0, true), target;
 
17
        if (Y.UA.gecko) {
 
18
            a[0] = DOM_MOUSE_SCROLL;
 
19
            target = Y.config.win;
 
20
        } else {
 
21
            target = Y.config.doc;
 
22
        }
 
23
 
 
24
        if (a.length < 3) {
 
25
            a[2] = target;
 
26
        } else {
 
27
            a.splice(2, 0, target);
 
28
        }
 
29
 
 
30
        return a;
 
31
    };
 
32
 
 
33
/**
 
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.
 
37
 * @event mousewheel
 
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
 
43
 * @for YUI
 
44
 */
 
45
Y.Env.evt.plugins.mousewheel = {
 
46
    on: function() {
 
47
        return Y.Event._attach(fixArgs(arguments));
 
48
    },
 
49
 
 
50
    detach: function() {
 
51
        return Y.Event.detach.apply(Y.Event, fixArgs(arguments));
 
52
    }
 
53
};
 
54
 
 
55
 
 
56
}, '3.5.0' ,{requires:['node-base']});