wp/wp-includes/js/hoverIntent.js
changeset 19 3d72ae0968f4
parent 18 be944660c56a
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
     1 /*!
     1 /*!
     2  * hoverIntent v1.10.1 // 2019.10.05 // jQuery v1.7.0+
     2  * hoverIntent v1.10.2 // 2020.04.28 // jQuery v1.7.0+
     3  * http://briancherne.github.io/jquery-hoverIntent/
     3  * http://briancherne.github.io/jquery-hoverIntent/
     4  *
     4  *
     5  * You may use hoverIntent under the terms of the MIT license. Basically that
     5  * You may use hoverIntent under the terms of the MIT license. Basically that
     6  * means you are free to use hoverIntent as long as this header is left intact.
     6  * means you are free to use hoverIntent as long as this header is left intact.
     7  * Copyright 2007-2019 Brian Cherne
     7  * Copyright 2007-2019 Brian Cherne
    90             delete data[s.id];
    90             delete data[s.id];
    91         }
    91         }
    92         return out.apply($el[0],[ev]);
    92         return out.apply($el[0],[ev]);
    93     };
    93     };
    94 
    94 
       
    95     // checks if `value` is a function
       
    96     var isFunction = function(value) {
       
    97         return typeof value === 'function';
       
    98     };
       
    99 
    95     $.fn.hoverIntent = function(handlerIn,handlerOut,selector) {
   100     $.fn.hoverIntent = function(handlerIn,handlerOut,selector) {
    96         // instance ID, used as a key to store and retrieve state information on an element
   101         // instance ID, used as a key to store and retrieve state information on an element
    97         var instanceId = INSTANCE_COUNT++;
   102         var instanceId = INSTANCE_COUNT++;
    98 
   103 
    99         // extend the default configuration and parse parameters
   104         // extend the default configuration and parse parameters
   100         var cfg = $.extend({}, _cfg);
   105         var cfg = $.extend({}, _cfg);
   101         if ( $.isPlainObject(handlerIn) ) {
   106         if ( $.isPlainObject(handlerIn) ) {
   102             cfg = $.extend(cfg, handlerIn);
   107             cfg = $.extend(cfg, handlerIn);
   103             if ( !$.isFunction(cfg.out) ) {
   108             if ( !isFunction(cfg.out) ) {
   104                 cfg.out = cfg.over;
   109                 cfg.out = cfg.over;
   105             }
   110             }
   106         } else if ( $.isFunction(handlerOut) ) {
   111         } else if ( isFunction(handlerOut) ) {
   107             cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } );
   112             cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } );
   108         } else {
   113         } else {
   109             cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } );
   114             cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } );
   110         }
   115         }
   111 
   116