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

Skip to content

Commit 922cc30

Browse files
committed
Merge pull request gridstack#247 from parano/command-js-fix
Support for commonJS
2 parents 7cc5271 + 3be2105 commit 922cc30

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/gridstack.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
define(['jquery', 'lodash', 'jquery-ui/core', 'jquery-ui/widget', 'jquery-ui/mouse', 'jquery-ui/draggable',
99
'jquery-ui/resizable'], factory);
1010
}
11+
else if (typeof exports !== 'undefined') {
12+
try { jQuery = require('jquery'); } catch(e) {}
13+
try { _ = require('lodash'); } catch(e) {}
14+
factory(jQuery, _);
15+
}
1116
else {
1217
factory(jQuery, _);
1318
}

0 commit comments

Comments
 (0)