Skip to content

Commit

Permalink
feat(gridster): Common.js support
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoafrmartins authored and vieron committed Apr 14, 2015
1 parent ccbac1f commit 446852a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
5 changes: 3 additions & 2 deletions src/jquery.collision.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
*/

;(function(root, factory) {

if (typeof define === 'function' && define.amd) {
if (typeof exports === 'object') {
module.exports = factory(require('jquery'), require('./jquery.coords.js'));
} else if (typeof define === 'function' && define.amd) {
define('gridster-collision', ['jquery', 'gridster-coords'], factory);
} else {
root.GridsterCollision = factory(root.$ || root.jQuery,
Expand Down
7 changes: 4 additions & 3 deletions src/jquery.coords.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
*/

;(function(root, factory) {

if (typeof define === 'function' && define.amd) {
if (typeof exports === 'object') {
module.exports = factory(require('jquery'));
} else if (typeof define === 'function' && define.amd) {
define('gridster-coords', ['jquery'], factory);
} else {
root.GridsterCoords = factory(root.$ || root.jQuery);
root.GridsterCoords = factory(root.$ || root.jQuery);
}

}(this, function($) {
Expand Down
5 changes: 3 additions & 2 deletions src/jquery.draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
*/

;(function(root, factory) {

if (typeof define === 'function' && define.amd) {
if (typeof exports === 'object') {
module.exports = factory(require('jquery'));
} else if (typeof define === 'function' && define.amd) {
define('gridster-draggable', ['jquery'], factory);
} else {
root.GridsterDraggable = factory(root.$ || root.jQuery);
Expand Down
5 changes: 3 additions & 2 deletions src/jquery.gridster.extras.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
;(function(root, factory) {

if (typeof define === 'function' && define.amd) {
if (typeof exports === 'object') {
module.exports = factory(require('jquery'), require('./jquery.gridster.js'));
} else if (typeof define === 'function' && define.amd) {
define(['jquery', 'gridster'], factory);
} else {
root.Gridster = factory(root.$ || root.jQuery, root.Gridster);
Expand Down
7 changes: 5 additions & 2 deletions src/jquery.gridster.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
*/

;(function(root, factory) {

if (typeof define === 'function' && define.amd) {
if (typeof exports === 'object') {
module.exports = factory(require('jquery'),
require('./jquery.draggable.js'), require('./jquery.collision.js'),
require('./utils.js'));
} else if (typeof define === 'function' && define.amd) {
define(['jquery', 'gridster-draggable', 'gridster-collision'], factory);
} else {
root.Gridster = factory(root.$ || root.jQuery, root.GridsterDraggable,
Expand Down

0 comments on commit 446852a

Please sign in to comment.