Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tweaked the fns param check

Signed-off-by: Aaron Heckmann <aaron.heckmann@gmacfs.com>
  • Loading branch information...
commit 257d393d0f85bf70c9daee5717869e5b98039552 1 parent cb774b6
Aaron Heckmann authored
Showing with 8 additions and 10 deletions.
  1. +8 −10 jquery.hook.js
View
18 jquery.hook.js
@@ -35,11 +35,10 @@
*/
;(function($){
$.hook = function (fns) {
- if (typeof fns === 'string') {
- fns = fns.split(' ');
- } else {
- fns = $.makeArray(fns);
- }
+ fns = typeof fns === 'string' ?
+ fns.split(' ') :
+ $.makeArray(fns)
+ ;
jQuery.each( fns, function (i, method) {
var old = $.fn[ method ];
@@ -62,11 +61,10 @@
};
$.unhook = function (fns) {
- if (typeof fns === 'string') {
- fns = fns.split(' ');
- } else {
- fns = $.makeArray(fns);
- }
+ fns = typeof fns === 'string' ?
+ fns.split(' ') :
+ $.makeArray(fns)
+ ;
jQuery.each( $.makeArray(fns), function (i, method) {
var cur = $.fn[ method ];
Please sign in to comment.
Something went wrong with that request. Please try again.