nexus site path corrected
[portal.git] / ecomp-portal-FE / client / bower_components / jquery / src / event / focusin.js
1 define( [
2         "../core",
3         "../data/var/dataPriv",
4         "./support",
5
6         "../event",
7         "./trigger"
8 ], function( jQuery, dataPriv, support ) {
9
10 // Support: Firefox
11 // Firefox doesn't have focus(in | out) events
12 // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
13 //
14 // Support: Chrome, Safari
15 // focus(in | out) events fire after focus & blur events,
16 // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
17 // Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857
18 if ( !support.focusin ) {
19         jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
20
21                 // Attach a single capturing handler on the document while someone wants focusin/focusout
22                 var handler = function( event ) {
23                         jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
24                 };
25
26                 jQuery.event.special[ fix ] = {
27                         setup: function() {
28                                 var doc = this.ownerDocument || this,
29                                         attaches = dataPriv.access( doc, fix );
30
31                                 if ( !attaches ) {
32                                         doc.addEventListener( orig, handler, true );
33                                 }
34                                 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
35                         },
36                         teardown: function() {
37                                 var doc = this.ownerDocument || this,
38                                         attaches = dataPriv.access( doc, fix ) - 1;
39
40                                 if ( !attaches ) {
41                                         doc.removeEventListener( orig, handler, true );
42                                         dataPriv.remove( doc, fix );
43
44                                 } else {
45                                         dataPriv.access( doc, fix, attaches );
46                                 }
47                         }
48                 };
49         } );
50 }
51
52 return jQuery;
53 } );