~ubuntu-branches/ubuntu/trusty/moodle/trusty-proposed

« back to all changes in this revision

Viewing changes to lib/yui/3.4.1/build/event-hover/event-hover-debug.js

  • Committer: Package Import Robot
  • Author(s): Thijs Kinkhorst
  • Date: 2013-07-19 08:52:46 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20130719085246-yebwditc2exoap2r
Tags: 2.5.1-1
* New upstream version: 2.5.1.
  - Fixes security issues:
    CVE-2013-2242 CVE-2013-2243 CVE-2013-2244 CVE-2013-2245
    CVE-2013-2246
* Depend on apache2 instead of obsolete apache2-mpm-prefork.
* Use packaged libphp-phpmailer (closes: #429339), adodb,
  HTMLPurifier, PclZip.
* Update debconf translations, thanks Salvatore Merone, Pietro Tollot,
  Joe Hansen, Yuri Kozlov, Holger Wansing, Américo Monteiro,
  Adriano Rafael Gomes, victory, Michał Kułach.
  (closes: #716972, #716986, #717080, #717108, #717278)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
YUI 3.4.1 (build 4118)
3
 
Copyright 2011 Yahoo! Inc. All rights reserved.
4
 
Licensed under the BSD License.
5
 
http://yuilibrary.com/license/
6
 
*/
7
 
YUI.add('event-hover', function(Y) {
8
 
 
9
 
/**
10
 
 * Adds support for a "hover" event.  The event provides a convenience wrapper
11
 
 * for subscribing separately to mouseenter and mouseleave.  The signature for
12
 
 * subscribing to the event is</p>
13
 
 *
14
 
 * <pre><code>node.on("hover", overFn, outFn);
15
 
 * node.delegate("hover", overFn, outFn, ".filterSelector");
16
 
 * Y.on("hover", overFn, outFn, ".targetSelector");
17
 
 * Y.delegate("hover", overFn, outFn, "#container", ".filterSelector");
18
 
 * </code></pre>
19
 
 *
20
 
 * <p>Additionally, for compatibility with a more typical subscription
21
 
 * signature, the following are also supported:</p>
22
 
 *
23
 
 * <pre><code>Y.on("hover", overFn, ".targetSelector", outFn);
24
 
 * Y.delegate("hover", overFn, "#container", outFn, ".filterSelector");
25
 
 * </code></pre>
26
 
 *
27
 
 * @module event
28
 
 * @submodule event-hover
29
 
 */
30
 
var isFunction = Y.Lang.isFunction,
31
 
    noop = function () {},
32
 
    conf = {
33
 
        processArgs: function (args) {
34
 
            // Y.delegate('hover', over, out, '#container', '.filter')
35
 
            // comes in as ['hover', over, out, '#container', '.filter'], but
36
 
            // node.delegate('hover', over, out, '.filter')
37
 
            // comes in as ['hover', over, containerEl, out, '.filter']
38
 
            var i = isFunction(args[2]) ? 2 : 3;
39
 
 
40
 
            return (isFunction(args[i])) ? args.splice(i,1)[0] : noop;
41
 
        },
42
 
 
43
 
        on: function (node, sub, notifier, filter) {
44
 
            var args = (sub.args) ? sub.args.slice() : [];
45
 
 
46
 
            args.unshift(null);
47
 
 
48
 
            sub._detach = node[(filter) ? "delegate" : "on"]({
49
 
                mouseenter: function (e) {
50
 
                    e.phase = 'over';
51
 
                    notifier.fire(e);
52
 
                },
53
 
                mouseleave: function (e) {
54
 
                    var thisObj = sub.context || this;
55
 
 
56
 
                    args[0] = e;
57
 
 
58
 
                    e.type = 'hover';
59
 
                    e.phase = 'out';
60
 
                    sub._extra.apply(thisObj, args);
61
 
                }
62
 
            }, filter);
63
 
        },
64
 
 
65
 
        detach: function (node, sub, notifier) {
66
 
            sub._detach.detach();
67
 
        }
68
 
    };
69
 
 
70
 
conf.delegate = conf.on;
71
 
conf.detachDelegate = conf.detach;
72
 
 
73
 
Y.Event.define("hover", conf);
74
 
 
75
 
 
76
 
}, '3.4.1' ,{requires:['event-mouseenter']});