Permalink
Browse files

tweaked the fns param check

Signed-off-by: Aaron Heckmann <aaron.heckmann@gmacfs.com>
  • Loading branch information...
Aaron Heckmann
Aaron Heckmann committed Jan 18, 2010
1 parent cb774b6 commit 257d393d0f85bf70c9daee5717869e5b98039552
Showing with 8 additions and 10 deletions.
  1. +8 −10 jquery.hook.js
View
@@ -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 ];

0 comments on commit 257d393

Please sign in to comment.