jquery.bootgrid.js, minor enhancements, https://github.com/opnsense/jquery-bootgrid

This commit is contained in:
Ad Schellevis 2019-03-11 21:21:29 +01:00
parent f921ec3cb8
commit 0d199f3ec1

View File

@ -1,5 +1,5 @@
/*!
* jQuery Bootgrid v1.3.4 - 03/08/2019
/*!
* jQuery Bootgrid v1.3.5 - 03/11/2019
* Copyright © 2014-2015 Rafael J. Staib; Copyright © 2018-2019 Deciso B.V. (http://www.jquery-bootgrid.com)
* Licensed under the MIT license. See LICENSE.txt for more details.
*/
@ -116,7 +116,7 @@ function loadColumns()
id: data.columnId,
identifier: that.identifier == null && data.identifier || false,
converter: that.options.converters[data.converter || data.type] || that.options.converters["string"],
text: $this.text(),
text: $this.html(),
align: data.align || "left",
headerAlign: data.headerAlign || "left",
cssClass: data.cssClass || "",
@ -1202,7 +1202,14 @@ Grid.defaults = {
converters: {
numeric: {
from: function (value) { return +value; }, // converts from string to numeric
to: function (value) { return value + ""; } // converts from numeric to string
to: function (value) {
// converts from numeric to string
if (value === undefined) {
return "";
} else {
return value + "";
}
}
},
string: {
// default converter
@ -1869,8 +1876,8 @@ $.fn.extend({
_bgBusyAria: function(busy)
{
return (busy == null || busy) ?
this._bgAria("busy", "true") :
return (busy == null || busy) ?
this._bgAria("busy", "true") :
this._bgAria("busy", "false");
},
@ -1881,29 +1888,29 @@ $.fn.extend({
_bgEnableAria: function (enable)
{
return (enable == null || enable) ?
this.removeClass("disabled")._bgAria("disabled", "false") :
return (enable == null || enable) ?
this.removeClass("disabled")._bgAria("disabled", "false") :
this.addClass("disabled")._bgAria("disabled", "true");
},
_bgEnableField: function (enable)
{
return (enable == null || enable) ?
this.removeAttr("disabled") :
return (enable == null || enable) ?
this.removeAttr("disabled") :
this.attr("disabled", "disable");
},
_bgShowAria: function (show)
{
return (show == null || show) ?
return (show == null || show) ?
this.show()._bgAria("hidden", "false") :
this.hide()._bgAria("hidden", "true");
},
_bgSelectAria: function (select)
{
return (select == null || select) ?
this.addClass("active")._bgAria("selected", "true") :
return (select == null || select) ?
this.addClass("active")._bgAria("selected", "true") :
this.removeClass("active")._bgAria("selected", "false");
},
@ -1993,8 +2000,8 @@ if (!Array.prototype.page)
{
var skip = (page - 1) * size,
end = skip + size;
return (this.length > skip) ?
(this.length > end) ? this.slice(skip, end) :
return (this.length > skip) ?
(this.length > end) ? this.slice(skip, end) :
this.slice(skip) : [];
};
}
@ -2083,4 +2090,4 @@ $.fn.bootgrid.noConflict = function ()
// ============
$("[data-toggle=\"bootgrid\"]").bootgrid();
})(jQuery, window);
})(jQuery, window);