Skip to content

Commit

Permalink
Update chosen.ajaxaddition.jquery.js
Browse files Browse the repository at this point in the history
prevents Uncaught TypeError: Cannot use 'in' operator to search for 'loadingImg' in undefined
when no options defined (defaults is ok)
  • Loading branch information
faridco committed Feb 6, 2013
1 parent d7c3ae3 commit 5c4b163
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion chosen.ajaxaddition.jquery.js
Expand Up @@ -125,6 +125,9 @@
callback(data, textStatus, jqXHR);
}
};

// we expect option to be defined as hash
options ||= {};
//set loading image
if ('loadingImg' in options) {
loadingImg = options.loadingImg;
Expand Down Expand Up @@ -206,4 +209,4 @@

return select;
};
})(jQuery);
})(jQuery);

0 comments on commit 5c4b163

Please sign in to comment.