MDL-32843 import YUI 3.5.1
[moodle.git] / lib / yui / 3.5.1 / build / event-outside / event-outside-min.js
blobbd7c21dc2a16a0640ee94ec7bea0283411618380
1 /*
2 YUI 3.5.1 (build 22)
3 Copyright 2012 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
7 YUI.add("event-outside",function(b){var a=["blur","change","click","dblclick","focus","keydown","keypress","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","select","submit"];b.Event.defineOutside=function(e,d){d=d||(e+"outside");var c={on:function(h,f,g){f.handle=b.one("doc").on(e,function(i){if(this.isOutside(h,i.target)){i.currentTarget=h;g.fire(i);}},this);},detach:function(h,f,g){f.handle.detach();},delegate:function(i,g,h,f){g.handle=b.one("doc").delegate(e,function(j){if(this.isOutside(i,j.target)){h.fire(j);}},f,this);},isOutside:function(f,g){return g!==f&&!g.ancestor(function(h){return h===f;});}};c.detachDelegate=c.detach;b.Event.define(d,c);};b.Array.each(a,function(c){b.Event.defineOutside(c);});},"3.5.1",{requires:["event-synthetic"]});