Skip to content

Commit

Permalink
add snippet to be able to load jquery as a module
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryde committed Jul 14, 2016
1 parent 99034ae commit a3f1508
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions jquery.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
A simple jQuery modal (http:https://github.com/kylefox/jquery-modal)
Version 0.7.0
*/
(function($) {

(function (factory) {
if(typeof module === "object" && typeof module.exports === "object") {
factory(require("jquery"), window, document);
}
else {
factory(jQuery, window, document);
}
}(function($, window, document, undefined) {

var modals = [],
getCurrent = function() {
Expand Down Expand Up @@ -225,4 +233,4 @@
event.preventDefault();
$(this).modal();
});
})(jQuery);
}));

0 comments on commit a3f1508

Please sign in to comment.