support UMD

This commit is contained in:
joaoafrmartins
2014-09-17 00:03:02 +01:00
parent 1d06af1d5c
commit ddf8bbdd9e
5 changed files with 20 additions and 10 deletions
+4 -2
View File
@@ -7,8 +7,10 @@
*/
;(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-collision', ['jquery', 'gridster-coords'], factory);
} else {
root.GridsterCollision = factory(root.$ || root.jQuery,
+4 -2
View File
@@ -7,8 +7,10 @@
*/
;(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);
+4 -2
View File
@@ -7,8 +7,10 @@
*/
;(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);
+4 -2
View File
@@ -1,6 +1,8 @@
;(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);
+4 -2
View File
@@ -7,8 +7,10 @@
*/
;(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'));
}
else if (typeof define === 'function' && define.amd) {
define(['jquery', 'gridster-draggable', 'gridster-collision'], factory);
} else {
root.Gridster = factory(root.$ || root.jQuery, root.GridsterDraggable,