Skip to content

Commit 446852a

Browse files
joaoafrmartinsvieron
authored andcommitted
feat(gridster): Common.js support
Closes ducksboard#434
1 parent ccbac1f commit 446852a

5 files changed

+18
-11
lines changed

src/jquery.collision.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
*/
88

99
;(function(root, factory) {
10-
11-
if (typeof define === 'function' && define.amd) {
10+
if (typeof exports === 'object') {
11+
module.exports = factory(require('jquery'), require('./jquery.coords.js'));
12+
} else if (typeof define === 'function' && define.amd) {
1213
define('gridster-collision', ['jquery', 'gridster-coords'], factory);
1314
} else {
1415
root.GridsterCollision = factory(root.$ || root.jQuery,

src/jquery.coords.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
*/
88

99
;(function(root, factory) {
10-
11-
if (typeof define === 'function' && define.amd) {
10+
if (typeof exports === 'object') {
11+
module.exports = factory(require('jquery'));
12+
} else if (typeof define === 'function' && define.amd) {
1213
define('gridster-coords', ['jquery'], factory);
1314
} else {
14-
root.GridsterCoords = factory(root.$ || root.jQuery);
15+
root.GridsterCoords = factory(root.$ || root.jQuery);
1516
}
1617

1718
}(this, function($) {

src/jquery.draggable.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
*/
88

99
;(function(root, factory) {
10-
11-
if (typeof define === 'function' && define.amd) {
10+
if (typeof exports === 'object') {
11+
module.exports = factory(require('jquery'));
12+
} else if (typeof define === 'function' && define.amd) {
1213
define('gridster-draggable', ['jquery'], factory);
1314
} else {
1415
root.GridsterDraggable = factory(root.$ || root.jQuery);

src/jquery.gridster.extras.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
;(function(root, factory) {
2-
3-
if (typeof define === 'function' && define.amd) {
2+
if (typeof exports === 'object') {
3+
module.exports = factory(require('jquery'), require('./jquery.gridster.js'));
4+
} else if (typeof define === 'function' && define.amd) {
45
define(['jquery', 'gridster'], factory);
56
} else {
67
root.Gridster = factory(root.$ || root.jQuery, root.Gridster);

src/jquery.gridster.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
*/
88

99
;(function(root, factory) {
10-
11-
if (typeof define === 'function' && define.amd) {
10+
if (typeof exports === 'object') {
11+
module.exports = factory(require('jquery'),
12+
require('./jquery.draggable.js'), require('./jquery.collision.js'),
13+
require('./utils.js'));
14+
} else if (typeof define === 'function' && define.amd) {
1215
define(['jquery', 'gridster-draggable', 'gridster-collision'], factory);
1316
} else {
1417
root.Gridster = factory(root.$ || root.jQuery, root.GridsterDraggable,

0 commit comments

Comments
 (0)