Skip to content

Commit

Permalink
Add Browserify support
Browse files Browse the repository at this point in the history
  • Loading branch information
vodkabears committed Mar 31, 2015
1 parent a143ce5 commit 76aa7d5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
},
"homepage": "http://vodkabears.github.io/remodal/",
"license": "MIT",
"main": "dist/jquery.remodal.js",
"dependencies": {
"jquery": "*"
},
Expand Down
19 changes: 15 additions & 4 deletions src/jquery.remodal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
!(function($) {
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], function($) {
return factory(root, $);
});
} else if (typeof exports === 'object') {
factory(root, require('jquery'));
} else {
factory(root, root.jQuery || root.Zepto);
}
})(this, function(global, $) {

'use strict';

/**
Expand All @@ -13,7 +24,7 @@
* @private
* @type {String}
*/
var namespace = window.remodalGlobals && window.remodalGlobals.namespace || pluginName;
var namespace = global.remodalGlobals && global.remodalGlobals.namespace || pluginName;

/**
* Default settings
Expand All @@ -26,7 +37,7 @@
closeOnCancel: true,
closeOnEscape: true,
closeOnAnyClick: true
}, window.remodalGlobals && window.remodalGlobals.defaults);
}, global.remodalGlobals && global.remodalGlobals.defaults);

/**
* Current modal
Expand Down Expand Up @@ -498,4 +509,4 @@

$(window).bind('hashchange.' + namespace, hashHandler);

})(window.jQuery || window.Zepto);
});

0 comments on commit 76aa7d5

Please sign in to comment.