Skip to content

Commit

Permalink
Added AMD support.
Browse files Browse the repository at this point in the history
  • Loading branch information
nakupanda committed Feb 25, 2014
1 parent 3d37911 commit b14ce37
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 57 deletions.
25 changes: 21 additions & 4 deletions examples/assets/bootstrap-dialog/js/bootstrap-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
*
* Licensed under The MIT License.
* ================================================ */
var BootstrapDialog = null;
!function($) {
(function($) {

"use strict";

BootstrapDialog = function(options) {
var BootstrapDialog = function(options) {
this.defaultOptions = {
id: BootstrapDialog.newGuid(),
type: BootstrapDialog.TYPE_PRIMARY,
Expand Down Expand Up @@ -786,4 +786,21 @@ var BootstrapDialog = null;
}]
}).open();
};
}(window.jQuery);

BootstrapDialog.init = function() {
// check for nodeJS
var hasModule = (typeof module !== 'undefined' && module.exports);

// CommonJS module is defined
if (hasModule)
module.exports = BootstrapDialog;
else if (typeof define === "function" && define.amd)
define("bootstrap-dialog", function() {
return BootstrapDialog;
});
else
window.BootstrapDialog = BootstrapDialog;
};
BootstrapDialog.init();

})(window.jQuery);
Loading

0 comments on commit b14ce37

Please sign in to comment.