Skip to content

Commit 60f430c

Browse files
authored
Merge pull request #79 from cdarne/deprecated-jquery-isfunction
Replace jQuery.isFunction by a typeof test
2 parents e2f72ef + 5a99d24 commit 60f430c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

jquery.hoverIntent.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@
9292
return out.apply($el[0],[ev]);
9393
};
9494

95+
// checks if `value` is a function
96+
var isFunction = function (value) {
97+
return typeof value === 'function';
98+
};
99+
95100
$.fn.hoverIntent = function(handlerIn,handlerOut,selector) {
96101
// instance ID, used as a key to store and retrieve state information on an element
97102
var instanceId = INSTANCE_COUNT++;
@@ -100,10 +105,10 @@
100105
var cfg = $.extend({}, _cfg);
101106
if ( $.isPlainObject(handlerIn) ) {
102107
cfg = $.extend(cfg, handlerIn);
103-
if ( !$.isFunction(cfg.out) ) {
108+
if ( !isFunction(cfg.out) ) {
104109
cfg.out = cfg.over;
105110
}
106-
} else if ( $.isFunction(handlerOut) ) {
111+
} else if ( isFunction(handlerOut) ) {
107112
cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } );
108113
} else {
109114
cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } );

0 commit comments

Comments
 (0)