mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
Merge commit 'fcbbaffce15ad99a8095616f55183ca39e0e16a7' as 'lib/jquery-bootgrid'
This commit is contained in:
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
// GRID PLUGIN DEFINITION
|
||||
// =====================
|
||||
|
||||
var old = $.fn.bootgrid;
|
||||
|
||||
$.fn.bootgrid = function (option)
|
||||
{
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
return this.each(function ()
|
||||
{
|
||||
var $this = $(this),
|
||||
instance = $this.data(namespace),
|
||||
options = typeof option === "object" && option;
|
||||
|
||||
if (!instance && option === "destroy")
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!instance)
|
||||
{
|
||||
$this.data(namespace, (instance = new Grid(this, options)));
|
||||
init.call(instance);
|
||||
}
|
||||
if (typeof option === "string")
|
||||
{
|
||||
return instance[option].apply(instance, args);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.bootgrid.Constructor = Grid;
|
||||
|
||||
// GRID NO CONFLICT
|
||||
// ===============
|
||||
|
||||
$.fn.bootgrid.noConflict = function ()
|
||||
{
|
||||
$.fn.bootgrid = old;
|
||||
return this;
|
||||
};
|
||||
|
||||
// GRID DATA-API
|
||||
// ============
|
||||
|
||||
$("[data-toggle=\"bootgrid\"]").bootgrid();
|
||||
Reference in New Issue
Block a user