Skip to content

Commit

Permalink
Merge pull request bootboxjs#436 from abhisekpaul/master
Browse files Browse the repository at this point in the history
fix for jquery plugins being lost, if bootbox is required later in the execution
  • Loading branch information
makeusabrew committed Sep 25, 2016
2 parents 725e98a + 0b4662e commit 76e2bc0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bootbox.js
Expand Up @@ -16,7 +16,15 @@
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require("jquery"));
if(typeof($) === "undefined")
{
module.exports = factory(require("jquery"));
}
else
{
module.exports = factory($);
}

} else {
// Browser globals (root is window)
root.bootbox = factory(root.jQuery);
Expand Down

0 comments on commit 76e2bc0

Please sign in to comment.