mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
feat: make gridster AMD compatible
This commit is contained in:
+12
-2
@@ -6,7 +6,16 @@
|
||||
* Licensed under the MIT licenses.
|
||||
*/
|
||||
|
||||
;(function($, window, document, undefined){
|
||||
;(function(root, factory) {
|
||||
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('gridster-collision', ['jquery', 'gridster-coords'], factory);
|
||||
} else {
|
||||
root.GridsterCollision = factory(root.$ || root.jQuery,
|
||||
root.GridsterCoords);
|
||||
}
|
||||
|
||||
}(this, function($, Coords) {
|
||||
|
||||
var defaults = {
|
||||
colliders_context: document.body,
|
||||
@@ -227,5 +236,6 @@
|
||||
return new Collision( this, collider, options );
|
||||
};
|
||||
|
||||
return Collision;
|
||||
|
||||
}(jQuery, window, document));
|
||||
}));
|
||||
|
||||
+12
-2
@@ -6,7 +6,15 @@
|
||||
* Licensed under the MIT licenses.
|
||||
*/
|
||||
|
||||
;(function($, window, document, undefined){
|
||||
;(function(root, factory) {
|
||||
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('gridster-coords', ['jquery'], factory);
|
||||
} else {
|
||||
root.GridsterCoords = factory(root.$ || root.jQuery);
|
||||
}
|
||||
|
||||
}(this, function($) {
|
||||
/**
|
||||
* Creates objects with coordinates (x1, y1, x2, y2, cx, cy, width, height)
|
||||
* to simulate DOM elements on the screen.
|
||||
@@ -112,4 +120,6 @@
|
||||
return ins;
|
||||
};
|
||||
|
||||
}(jQuery, window, document));
|
||||
return Coords;
|
||||
|
||||
}));
|
||||
|
||||
+11
-2
@@ -6,7 +6,15 @@
|
||||
* Licensed under the MIT licenses.
|
||||
*/
|
||||
|
||||
;(function($, window, document, undefined) {
|
||||
;(function(root, factory) {
|
||||
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('gridster-draggable', ['jquery'], factory);
|
||||
} else {
|
||||
root.GridsterDraggable = factory(root.$ || root.jQuery);
|
||||
}
|
||||
|
||||
}(this, function($) {
|
||||
|
||||
var defaults = {
|
||||
items: 'li',
|
||||
@@ -402,5 +410,6 @@
|
||||
return new Draggable(this, options);
|
||||
};
|
||||
|
||||
return Draggable;
|
||||
|
||||
}(jQuery, window, document));
|
||||
}));
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
;(function($, window, document, undefined) {
|
||||
;(function(root, factory) {
|
||||
|
||||
var fn = $.Gridster;
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(['jquery', 'gridster'], factory);
|
||||
} else {
|
||||
root.Gridster = factory(root.$ || root.jQuery, root.Gridster);
|
||||
}
|
||||
|
||||
}(this, function($, Gridster) {
|
||||
|
||||
var fn = Gridster.prototype;
|
||||
|
||||
fn.widgets_in_col = function(col) {
|
||||
if (!this.gridmap[col]) {
|
||||
@@ -162,4 +170,6 @@
|
||||
return false;
|
||||
};
|
||||
|
||||
}(jQuery, window, document));
|
||||
return Gridster;
|
||||
|
||||
}));
|
||||
|
||||
+13
-3
@@ -5,7 +5,17 @@
|
||||
* Copyright (c) 2012 ducksboard
|
||||
* Licensed under the MIT licenses.
|
||||
*/
|
||||
;(function($, window, document, undefined) {
|
||||
|
||||
;(function(root, factory) {
|
||||
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(['jquery', 'gridster-draggable', 'gridster-collision'], factory);
|
||||
} else {
|
||||
root.Gridster = factory(root.$ || root.jQuery, root.GridsterDraggable,
|
||||
root.GridsterCollision);
|
||||
}
|
||||
|
||||
}(this, function($, Draggable, Collision) {
|
||||
|
||||
var defaults = {
|
||||
namespace: '',
|
||||
@@ -3111,6 +3121,6 @@
|
||||
});
|
||||
};
|
||||
|
||||
$.Gridster = fn;
|
||||
return Gridster;
|
||||
|
||||
}(jQuery, window, document));
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user