Skip to content

Commit

Permalink
Merge branch 'peter-mouland-isomorphic-window'
Browse files Browse the repository at this point in the history
  • Loading branch information
dangrossman committed Sep 30, 2015
2 parents 385be82 + 2df6a20 commit 5073b2b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions daterangepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
});

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

factory(root, exports, momentjs, jQuery);

Expand Down

0 comments on commit 5073b2b

Please sign in to comment.