Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e84a7d9

Browse files
authored
Merge pull request gridstack#974 from garvank/develop
Don't overwrite globals when in a modular environment.
2 parents da1966a + 6fe7dc9 commit e84a7d9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/gridstack.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
if (typeof define === 'function' && define.amd) {
1010
define(['jquery', 'exports'], factory);
1111
} else if (typeof exports !== 'undefined') {
12-
try { jQuery = require('jquery'); } catch (e) {}
13-
factory(jQuery, exports);
12+
var jQueryModule;
13+
14+
try { jQueryModule = require('jquery'); } catch (e) {}
15+
16+
factory(jQueryModule || window.jQuery, exports);
1417
} else {
15-
factory(jQuery, window);
18+
factory(window.jQuery, window);
1619
}
1720
})(function($, scope) {
1821
var obsolete = function(f, oldName, newName) {

0 commit comments

Comments
 (0)