|
|
@@ -4,7 +4,7 @@
|
|
|
* https://github.com/wenzhixin/bootstrap-table/
|
|
|
*/
|
|
|
|
|
|
-! function ($) {
|
|
|
+!function ($) {
|
|
|
'use strict';
|
|
|
|
|
|
// TOOLS DEFINITION
|
|
|
@@ -95,7 +95,7 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
|
|
|
var getScrollBarWidth = function () {
|
|
|
if (cachedWidth === null) {
|
|
|
@@ -210,11 +210,11 @@
|
|
|
|
|
|
return dataAttr;
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
var getItemField = function (item, field) {
|
|
|
var props = field.split('.');
|
|
|
var value = item;
|
|
|
- for(var p in props) {
|
|
|
+ for (var p in props) {
|
|
|
value = value[props[p]];
|
|
|
}
|
|
|
return value;
|
|
|
@@ -524,26 +524,26 @@
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
BootstrapTable.prototype.initContainer = function () {
|
|
|
this.$container = $([
|
|
|
'<div class="bootstrap-table">',
|
|
|
- '<div class="fixed-table-toolbar"></div>',
|
|
|
- this.options.paginationVAlign === 'top' || this.options.paginationVAlign === 'both' ?
|
|
|
- '<div class="fixed-table-pagination" style="clear: both;"></div>' :
|
|
|
- '',
|
|
|
- '<div class="fixed-table-container">',
|
|
|
- '<div class="fixed-table-header"><table></table></div>',
|
|
|
- '<div class="fixed-table-body">',
|
|
|
- '<div class="fixed-table-loading">',
|
|
|
- this.options.formatLoadingMessage(),
|
|
|
- '</div>',
|
|
|
- '</div>',
|
|
|
- '<div class="fixed-table-footer"><table><tr></tr></table></div>',
|
|
|
- this.options.paginationVAlign === 'bottom' || this.options.paginationVAlign === 'both' ?
|
|
|
+ '<div class="fixed-table-toolbar"></div>',
|
|
|
+ this.options.paginationVAlign === 'top' || this.options.paginationVAlign === 'both' ?
|
|
|
+ '<div class="fixed-table-pagination" style="clear: both;"></div>' :
|
|
|
+ '',
|
|
|
+ '<div class="fixed-table-container">',
|
|
|
+ '<div class="fixed-table-header"><table></table></div>',
|
|
|
+ '<div class="fixed-table-body">',
|
|
|
+ '<div class="fixed-table-loading">',
|
|
|
+ this.options.formatLoadingMessage(),
|
|
|
+ '</div>',
|
|
|
+ '</div>',
|
|
|
+ '<div class="fixed-table-footer"><table><tr></tr></table></div>',
|
|
|
+ this.options.paginationVAlign === 'bottom' || this.options.paginationVAlign === 'both' ?
|
|
|
'<div class="fixed-table-pagination"></div>' :
|
|
|
'',
|
|
|
- '</div>',
|
|
|
+ '</div>',
|
|
|
'</div>'
|
|
|
].join(''));
|
|
|
|
|
|
@@ -714,8 +714,8 @@
|
|
|
|
|
|
html.push('<th' + sprintf(' title="%s"', column.titleTooltip),
|
|
|
column.checkbox || column.radio ?
|
|
|
- sprintf(' class="bs-checkbox %s"', column['class'] || '') :
|
|
|
- class_,
|
|
|
+ sprintf(' class="bs-checkbox %s"', column['class'] || '') :
|
|
|
+ class_,
|
|
|
sprintf(' style="%s"', halign + style),
|
|
|
sprintf(' rowspan="%s"', column.rowspan),
|
|
|
sprintf(' colspan="%s"', column.colspan),
|
|
|
@@ -762,7 +762,7 @@
|
|
|
this.$header.children().children().off('keypress').on('keypress', function (event) {
|
|
|
if (that.options.sortable && $(this).data().sortable) {
|
|
|
var code = event.keyCode || event.which;
|
|
|
- if(code == 13) { //Enter keycode
|
|
|
+ if (code == 13) { //Enter keycode
|
|
|
that.onSort(event);
|
|
|
}
|
|
|
}
|
|
|
@@ -1103,7 +1103,7 @@
|
|
|
}
|
|
|
} else {
|
|
|
if ((value + '').toLowerCase().indexOf(s) !== -1) {
|
|
|
- return true;
|
|
|
+ return true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1176,10 +1176,10 @@
|
|
|
var pageNumber = [
|
|
|
sprintf('<span class="btn-group %s">',
|
|
|
this.options.paginationVAlign === 'top' || this.options.paginationVAlign === 'both' ?
|
|
|
- 'dropdown' : 'dropup'),
|
|
|
+ 'dropdown' : 'dropup'),
|
|
|
'<button type="button" class="btn btn-default ' +
|
|
|
- (this.options.iconSize === undefined ? '' : ' btn-' + this.options.iconSize) +
|
|
|
- ' dropdown-toggle" data-toggle="dropdown">',
|
|
|
+ (this.options.iconSize === undefined ? '' : ' btn-' + this.options.iconSize) +
|
|
|
+ ' dropdown-toggle" data-toggle="dropdown">',
|
|
|
'<span class="page-size">',
|
|
|
$allSelected ? this.options.formatAllRows() : this.options.pageSize,
|
|
|
'</span>',
|
|
|
@@ -1493,9 +1493,9 @@
|
|
|
sprintf(' type="%s"', type) +
|
|
|
sprintf(' value="%s"', item[that.options.idField]) +
|
|
|
sprintf(' checked="%s"', value === true ||
|
|
|
- (value && value.checked) ? 'checked' : undefined) +
|
|
|
+ (value && value.checked) ? 'checked' : undefined) +
|
|
|
sprintf(' disabled="%s"', !column.checkboxEnabled ||
|
|
|
- (value && value.disabled) ? 'disabled' : undefined) +
|
|
|
+ (value && value.disabled) ? 'disabled' : undefined) +
|
|
|
' />',
|
|
|
that.options.cardView ? '</div>' : '</td>'
|
|
|
].join('');
|
|
|
@@ -1814,19 +1814,19 @@
|
|
|
fixedBody = this.$tableBody.get(0);
|
|
|
|
|
|
scrollWidth = fixedBody.scrollWidth > fixedBody.clientWidth &&
|
|
|
- fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ?
|
|
|
+ fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ?
|
|
|
getScrollBarWidth() : 0;
|
|
|
|
|
|
this.$el.css('margin-top', -this.$header.outerHeight());
|
|
|
|
|
|
focused = $(':focus');
|
|
|
- if(focused.length > 0) {
|
|
|
+ if (focused.length > 0) {
|
|
|
var $th = focused.parents('th');
|
|
|
- if($th.length > 0) {
|
|
|
+ if ($th.length > 0) {
|
|
|
var dataField = $th.attr('data-field');
|
|
|
- if(dataField !== undefined) {
|
|
|
+ if (dataField !== undefined) {
|
|
|
var $headerTh = this.$header.find("[data-field='" + dataField + "']");
|
|
|
- if($headerTh.length > 0) {
|
|
|
+ if ($headerTh.length > 0) {
|
|
|
$headerTh.find(":input").addClass("focus-temp");
|
|
|
}
|
|
|
}
|
|
|
@@ -1843,7 +1843,7 @@
|
|
|
|
|
|
|
|
|
focusedTemp = $('.focus-temp:visible:eq(0)');
|
|
|
- if(focusedTemp.length > 0) {
|
|
|
+ if (focusedTemp.length > 0) {
|
|
|
focusedTemp.focus();
|
|
|
this.$header.find('.focus-temp').removeClass('focus-temp');
|
|
|
}
|
|
|
@@ -1943,8 +1943,8 @@
|
|
|
scrollWidth = elWidth > this.$tableBody.width() ? getScrollBarWidth() : 0;
|
|
|
|
|
|
this.$tableFooter.css({
|
|
|
- 'margin-right': scrollWidth
|
|
|
- }).find('table').css('width', elWidth)
|
|
|
+ 'margin-right': scrollWidth
|
|
|
+ }).find('table').css('width', elWidth)
|
|
|
.attr('class', this.$el.attr('class'));
|
|
|
|
|
|
$footerTd = this.$tableFooter.find('td');
|
|
|
@@ -2403,7 +2403,7 @@
|
|
|
};
|
|
|
|
|
|
BootstrapTable.prototype.getHiddenColumns = function () {
|
|
|
- return $.grep(this.columns, function( column ) {
|
|
|
+ return $.grep(this.columns, function (column) {
|
|
|
return !column.visible;
|
|
|
});
|
|
|
};
|