Skip to content

Commit

Permalink
Merge pull request #743 from paltman/master
Browse files Browse the repository at this point in the history
Use jQuery if already loaded
  • Loading branch information
dangrossman committed Aug 2, 2015
2 parents 5a616f4 + f05b569 commit 563a458
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions daterangepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@

} else if (typeof exports !== 'undefined') {
var momentjs = require('moment');
var jQuery;
try {
jQuery = require('jquery');
} catch (err) {
jQuery = window.jQuery;
if (!jQuery) throw new Error('jQuery dependnecy not found');
var jQuery = window.jQuery;
if (jQuery === undefined) {
try {
jQuery = require('jquery');
} catch (err) {
if (!jQuery) throw new Error('jQuery dependency not found');
}
}

factory(root, exports, momentjs, jQuery);
Expand Down

0 comments on commit 563a458

Please sign in to comment.