|
1 | 1 | /** |
2 | 2 | * @author zhixin wen <[email protected]> |
3 | | - * version: 1.11.8 |
| 3 | + * version: 1.11.9 |
4 | 4 | * https://github.com/wenzhixin/bootstrap-table/ |
5 | 5 | */ |
6 | 6 |
|
|
453 | 453 | return false; |
454 | 454 | }, |
455 | 455 | onRefresh: function (params) { |
456 | | - return false; |
| 456 | + return false; |
457 | 457 | }, |
458 | 458 | onResetView: function () { |
459 | 459 | return false; |
|
881 | 881 |
|
882 | 882 | this.$selectAll = this.$header.find('[name="btSelectAll"]'); |
883 | 883 | this.$selectAll.off('click').on('click', function () { |
884 | | - var checked = $(this).prop('checked'); |
885 | | - that[checked ? 'checkAll' : 'uncheckAll'](); |
886 | | - that.updateSelected(); |
887 | | - }); |
| 884 | + var checked = $(this).prop('checked'); |
| 885 | + that[checked ? 'checkAll' : 'uncheckAll'](); |
| 886 | + that.updateSelected(); |
| 887 | + }); |
888 | 888 | }; |
889 | 889 |
|
890 | 890 | BootstrapTable.prototype.initFooter = function () { |
|
1064 | 1064 |
|
1065 | 1065 | if (this.options.showPaginationSwitch) { |
1066 | 1066 | html.push(sprintf('<button class="btn' + |
1067 | | - sprintf(' btn-%s', this.options.buttonsClass) + |
1068 | | - sprintf(' btn-%s', this.options.iconSize) + |
1069 | | - '" type="button" name="paginationSwitch" aria-label="pagination Switch" title="%s">', |
1070 | | - this.options.formatPaginationSwitch()), |
| 1067 | + sprintf(' btn-%s', this.options.buttonsClass) + |
| 1068 | + sprintf(' btn-%s', this.options.iconSize) + |
| 1069 | + '" type="button" name="paginationSwitch" aria-label="pagination Switch" title="%s">', |
| 1070 | + this.options.formatPaginationSwitch()), |
1071 | 1071 | sprintf('<i class="%s %s"></i>', this.options.iconsPrefix, this.options.icons.paginationSwitchDown), |
1072 | 1072 | '</button>'); |
1073 | 1073 | } |
1074 | 1074 |
|
1075 | 1075 | if (this.options.showRefresh) { |
1076 | 1076 | html.push(sprintf('<button class="btn' + |
1077 | | - sprintf(' btn-%s', this.options.buttonsClass) + |
1078 | | - sprintf(' btn-%s', this.options.iconSize) + |
1079 | | - '" type="button" name="refresh" aria-label="refresh" title="%s">', |
1080 | | - this.options.formatRefresh()), |
| 1077 | + sprintf(' btn-%s', this.options.buttonsClass) + |
| 1078 | + sprintf(' btn-%s', this.options.iconSize) + |
| 1079 | + '" type="button" name="refresh" aria-label="refresh" title="%s">', |
| 1080 | + this.options.formatRefresh()), |
1081 | 1081 | sprintf('<i class="%s %s"></i>', this.options.iconsPrefix, this.options.icons.refresh), |
1082 | 1082 | '</button>'); |
1083 | 1083 | } |
1084 | 1084 |
|
1085 | 1085 | if (this.options.showToggle) { |
1086 | 1086 | html.push(sprintf('<button class="btn' + |
1087 | | - sprintf(' btn-%s', this.options.buttonsClass) + |
1088 | | - sprintf(' btn-%s', this.options.iconSize) + |
1089 | | - '" type="button" name="toggle" aria-label="toggle" title="%s">', |
1090 | | - this.options.formatToggle()), |
| 1087 | + sprintf(' btn-%s', this.options.buttonsClass) + |
| 1088 | + sprintf(' btn-%s', this.options.iconSize) + |
| 1089 | + '" type="button" name="toggle" aria-label="toggle" title="%s">', |
| 1090 | + this.options.formatToggle()), |
1091 | 1091 | sprintf('<i class="%s %s"></i>', this.options.iconsPrefix, this.options.icons.toggle), |
1092 | 1092 | '</button>'); |
1093 | 1093 | } |
1094 | 1094 |
|
1095 | 1095 | if (this.options.showColumns) { |
1096 | 1096 | html.push(sprintf('<div class="keep-open btn-group" title="%s">', |
1097 | | - this.options.formatColumns()), |
| 1097 | + this.options.formatColumns()), |
1098 | 1098 | '<button type="button" aria-label="columns" class="btn' + |
1099 | 1099 | sprintf(' btn-%s', this.options.buttonsClass) + |
1100 | 1100 | sprintf(' btn-%s', this.options.iconSize) + |
|
1146 | 1146 | if (this.options.showToggle) { |
1147 | 1147 | this.$toolbar.find('button[name="toggle"]') |
1148 | 1148 | .off('click').on('click', function () { |
1149 | | - that.toggleView(); |
1150 | | - }); |
| 1149 | + that.toggleView(); |
| 1150 | + }); |
1151 | 1151 | } |
1152 | 1152 |
|
1153 | 1153 | if (this.options.showColumns) { |
|
1243 | 1243 | this.data = f ? $.grep(this.options.data, function (item, i) { |
1244 | 1244 | for (var key in f) { |
1245 | 1245 | if ($.isArray(f[key]) && $.inArray(item[key], f[key]) === -1 || |
1246 | | - !$.isArray(f[key]) && item[key] !== f[key]) { |
| 1246 | + !$.isArray(f[key]) && item[key] !== f[key]) { |
1247 | 1247 | return false; |
1248 | 1248 | } |
1249 | 1249 | } |
|
1351 | 1351 | '<div class="pull-' + this.options.paginationDetailHAlign + ' pagination-detail">', |
1352 | 1352 | '<span class="pagination-info">', |
1353 | 1353 | this.options.onlyInfoPagination ? this.options.formatDetailPagination(this.options.totalRows) : |
1354 | | - this.options.formatShowingRows(this.pageFrom, this.pageTo, this.options.totalRows), |
| 1354 | + this.options.formatShowingRows(this.pageFrom, this.pageTo, this.options.totalRows), |
1355 | 1355 | '</span>'); |
1356 | 1356 |
|
1357 | 1357 | if (!this.options.onlyInfoPagination) { |
1358 | 1358 | html.push('<span class="page-list">'); |
1359 | 1359 |
|
1360 | 1360 | var pageNumber = [ |
1361 | | - sprintf('<span class="btn-group %s">', |
1362 | | - this.options.paginationVAlign === 'top' || this.options.paginationVAlign === 'both' ? |
1363 | | - 'dropdown' : 'dropup'), |
1364 | | - '<button type="button" class="btn' + |
1365 | | - sprintf(' btn-%s', this.options.buttonsClass) + |
1366 | | - sprintf(' btn-%s', this.options.iconSize) + |
1367 | | - ' dropdown-toggle" data-toggle="dropdown">', |
1368 | | - '<span class="page-size">', |
1369 | | - $allSelected ? this.options.formatAllRows() : this.options.pageSize, |
1370 | | - '</span>', |
1371 | | - ' <span class="caret"></span>', |
1372 | | - '</button>', |
1373 | | - '<ul class="dropdown-menu" role="menu">' |
1374 | | - ]; |
| 1361 | + sprintf('<span class="btn-group %s">', |
| 1362 | + this.options.paginationVAlign === 'top' || this.options.paginationVAlign === 'both' ? |
| 1363 | + 'dropdown' : 'dropup'), |
| 1364 | + '<button type="button" class="btn' + |
| 1365 | + sprintf(' btn-%s', this.options.buttonsClass) + |
| 1366 | + sprintf(' btn-%s', this.options.iconSize) + |
| 1367 | + ' dropdown-toggle" data-toggle="dropdown">', |
| 1368 | + '<span class="page-size">', |
| 1369 | + $allSelected ? this.options.formatAllRows() : this.options.pageSize, |
| 1370 | + '</span>', |
| 1371 | + ' <span class="caret"></span>', |
| 1372 | + '</button>', |
| 1373 | + '<ul class="dropdown-menu" role="menu">' |
| 1374 | + ]; |
1375 | 1375 |
|
1376 | 1376 | if (typeof this.options.pageList === 'string') { |
1377 | 1377 | var list = this.options.pageList.replace('[', '').replace(']', '') |
|
1744 | 1744 | type = column.radio ? 'radio' : type; |
1745 | 1745 |
|
1746 | 1746 | text = [sprintf(that.options.cardView ? |
1747 | | - '<div class="card-view %s">' : '<td class="bs-checkbox %s">', column['class'] || ''), |
| 1747 | + '<div class="card-view %s">' : '<td class="bs-checkbox %s">', column['class'] || ''), |
1748 | 1748 | '<input' + |
1749 | 1749 | sprintf(' data-index="%s"', i) + |
1750 | 1750 | sprintf(' name="%s"', that.options.selectItemName) + |
1751 | 1751 | sprintf(' type="%s"', type) + |
1752 | 1752 | sprintf(' value="%s"', item[that.options.idField]) + |
1753 | 1753 | sprintf(' checked="%s"', value === true || |
1754 | | - (value_ || value && value.checked) ? 'checked' : undefined) + |
| 1754 | + (value_ || value && value.checked) ? 'checked' : undefined) + |
1755 | 1755 | sprintf(' disabled="%s"', !column.checkboxEnabled || |
1756 | | - (value && value.disabled) ? 'disabled' : undefined) + |
| 1756 | + (value && value.disabled) ? 'disabled' : undefined) + |
1757 | 1757 | ' />', |
1758 | 1758 | that.header.formatters[j] && typeof value === 'string' ? value : '', |
1759 | 1759 | that.options.cardView ? '</div>' : '</td>' |
|
1770 | 1770 | sprintf('<span class="value">%s</span>', value), |
1771 | 1771 | '</div>' |
1772 | 1772 | ].join('') : [sprintf('<td%s %s %s %s %s %s %s>', |
1773 | | - id_, class_, style, data_, rowspan_, colspan_, title_), |
| 1773 | + id_, class_, style, data_, rowspan_, colspan_, title_), |
1774 | 1774 | value, |
1775 | 1775 | '</td>' |
1776 | 1776 | ].join(''); |
|
1828 | 1828 | if (!hasTr) { |
1829 | 1829 | trFragments.append('<tr class="no-records-found">' + |
1830 | 1830 | sprintf('<td colspan="%s">%s</td>', |
1831 | | - this.$header.find('th').length, |
1832 | | - this.options.formatNoMatches()) + |
| 1831 | + this.$header.find('th').length, |
| 1832 | + this.options.formatNoMatches()) + |
1833 | 1833 | '</tr>'); |
1834 | 1834 | } |
1835 | 1835 |
|
|
0 commit comments