|
4 | 4 | * https://github.com/wenzhixin/bootstrap-table/
|
5 | 5 | */
|
6 | 6 |
|
7 |
| -! function ($) { |
| 7 | +!function ($) { |
8 | 8 | 'use strict';
|
9 | 9 |
|
10 | 10 | // TOOLS DEFINITION
|
|
95 | 95 | }
|
96 | 96 | }
|
97 | 97 | }
|
98 |
| - } |
| 98 | + }; |
99 | 99 |
|
100 | 100 | var getScrollBarWidth = function () {
|
101 | 101 | if (cachedWidth === null) {
|
|
210 | 210 |
|
211 | 211 | return dataAttr;
|
212 | 212 | };
|
213 |
| - |
| 213 | + |
214 | 214 | var getItemField = function (item, field) {
|
215 | 215 | var props = field.split('.');
|
216 | 216 | var value = item;
|
217 |
| - for(var p in props) { |
| 217 | + for (var p in props) { |
218 | 218 | value = value[props[p]];
|
219 | 219 | }
|
220 | 220 | return value;
|
|
524 | 524 | }
|
525 | 525 | }
|
526 | 526 | };
|
527 |
| - |
| 527 | + |
528 | 528 | BootstrapTable.prototype.initContainer = function () {
|
529 | 529 | this.$container = $([
|
530 | 530 | '<div class="bootstrap-table">',
|
531 |
| - '<div class="fixed-table-toolbar"></div>', |
532 |
| - this.options.paginationVAlign === 'top' || this.options.paginationVAlign === 'both' ? |
533 |
| - '<div class="fixed-table-pagination" style="clear: both;"></div>' : |
534 |
| - '', |
535 |
| - '<div class="fixed-table-container">', |
536 |
| - '<div class="fixed-table-header"><table></table></div>', |
537 |
| - '<div class="fixed-table-body">', |
538 |
| - '<div class="fixed-table-loading">', |
539 |
| - this.options.formatLoadingMessage(), |
540 |
| - '</div>', |
541 |
| - '</div>', |
542 |
| - '<div class="fixed-table-footer"><table><tr></tr></table></div>', |
543 |
| - this.options.paginationVAlign === 'bottom' || this.options.paginationVAlign === 'both' ? |
| 531 | + '<div class="fixed-table-toolbar"></div>', |
| 532 | + this.options.paginationVAlign === 'top' || this.options.paginationVAlign === 'both' ? |
| 533 | + '<div class="fixed-table-pagination" style="clear: both;"></div>' : |
| 534 | + '', |
| 535 | + '<div class="fixed-table-container">', |
| 536 | + '<div class="fixed-table-header"><table></table></div>', |
| 537 | + '<div class="fixed-table-body">', |
| 538 | + '<div class="fixed-table-loading">', |
| 539 | + this.options.formatLoadingMessage(), |
| 540 | + '</div>', |
| 541 | + '</div>', |
| 542 | + '<div class="fixed-table-footer"><table><tr></tr></table></div>', |
| 543 | + this.options.paginationVAlign === 'bottom' || this.options.paginationVAlign === 'both' ? |
544 | 544 | '<div class="fixed-table-pagination"></div>' :
|
545 | 545 | '',
|
546 |
| - '</div>', |
| 546 | + '</div>', |
547 | 547 | '</div>'
|
548 | 548 | ].join(''));
|
549 | 549 |
|
|
714 | 714 |
|
715 | 715 | html.push('<th' + sprintf(' title="%s"', column.titleTooltip),
|
716 | 716 | column.checkbox || column.radio ?
|
717 |
| - sprintf(' class="bs-checkbox %s"', column['class'] || '') : |
718 |
| - class_, |
| 717 | + sprintf(' class="bs-checkbox %s"', column['class'] || '') : |
| 718 | + class_, |
719 | 719 | sprintf(' style="%s"', halign + style),
|
720 | 720 | sprintf(' rowspan="%s"', column.rowspan),
|
721 | 721 | sprintf(' colspan="%s"', column.colspan),
|
|
762 | 762 | this.$header.children().children().off('keypress').on('keypress', function (event) {
|
763 | 763 | if (that.options.sortable && $(this).data().sortable) {
|
764 | 764 | var code = event.keyCode || event.which;
|
765 |
| - if(code == 13) { //Enter keycode |
| 765 | + if (code == 13) { //Enter keycode |
766 | 766 | that.onSort(event);
|
767 | 767 | }
|
768 | 768 | }
|
|
1103 | 1103 | }
|
1104 | 1104 | } else {
|
1105 | 1105 | if ((value + '').toLowerCase().indexOf(s) !== -1) {
|
1106 |
| - return true; |
| 1106 | + return true; |
1107 | 1107 | }
|
1108 | 1108 | }
|
1109 | 1109 | }
|
|
1176 | 1176 | var pageNumber = [
|
1177 | 1177 | sprintf('<span class="btn-group %s">',
|
1178 | 1178 | this.options.paginationVAlign === 'top' || this.options.paginationVAlign === 'both' ?
|
1179 |
| - 'dropdown' : 'dropup'), |
| 1179 | + 'dropdown' : 'dropup'), |
1180 | 1180 | '<button type="button" class="btn btn-default ' +
|
1181 |
| - (this.options.iconSize === undefined ? '' : ' btn-' + this.options.iconSize) + |
1182 |
| - ' dropdown-toggle" data-toggle="dropdown">', |
| 1181 | + (this.options.iconSize === undefined ? '' : ' btn-' + this.options.iconSize) + |
| 1182 | + ' dropdown-toggle" data-toggle="dropdown">', |
1183 | 1183 | '<span class="page-size">',
|
1184 | 1184 | $allSelected ? this.options.formatAllRows() : this.options.pageSize,
|
1185 | 1185 | '</span>',
|
|
1493 | 1493 | sprintf(' type="%s"', type) +
|
1494 | 1494 | sprintf(' value="%s"', item[that.options.idField]) +
|
1495 | 1495 | sprintf(' checked="%s"', value === true ||
|
1496 |
| - (value && value.checked) ? 'checked' : undefined) + |
| 1496 | + (value && value.checked) ? 'checked' : undefined) + |
1497 | 1497 | sprintf(' disabled="%s"', !column.checkboxEnabled ||
|
1498 |
| - (value && value.disabled) ? 'disabled' : undefined) + |
| 1498 | + (value && value.disabled) ? 'disabled' : undefined) + |
1499 | 1499 | ' />',
|
1500 | 1500 | that.options.cardView ? '</div>' : '</td>'
|
1501 | 1501 | ].join('');
|
|
1814 | 1814 | fixedBody = this.$tableBody.get(0);
|
1815 | 1815 |
|
1816 | 1816 | scrollWidth = fixedBody.scrollWidth > fixedBody.clientWidth &&
|
1817 |
| - fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ? |
| 1817 | + fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ? |
1818 | 1818 | getScrollBarWidth() : 0;
|
1819 | 1819 |
|
1820 | 1820 | this.$el.css('margin-top', -this.$header.outerHeight());
|
1821 | 1821 |
|
1822 | 1822 | focused = $(':focus');
|
1823 |
| - if(focused.length > 0) { |
| 1823 | + if (focused.length > 0) { |
1824 | 1824 | var $th = focused.parents('th');
|
1825 |
| - if($th.length > 0) { |
| 1825 | + if ($th.length > 0) { |
1826 | 1826 | var dataField = $th.attr('data-field');
|
1827 |
| - if(dataField !== undefined) { |
| 1827 | + if (dataField !== undefined) { |
1828 | 1828 | var $headerTh = this.$header.find("[data-field='" + dataField + "']");
|
1829 |
| - if($headerTh.length > 0) { |
| 1829 | + if ($headerTh.length > 0) { |
1830 | 1830 | $headerTh.find(":input").addClass("focus-temp");
|
1831 | 1831 | }
|
1832 | 1832 | }
|
|
1843 | 1843 |
|
1844 | 1844 |
|
1845 | 1845 | focusedTemp = $('.focus-temp:visible:eq(0)');
|
1846 |
| - if(focusedTemp.length > 0) { |
| 1846 | + if (focusedTemp.length > 0) { |
1847 | 1847 | focusedTemp.focus();
|
1848 | 1848 | this.$header.find('.focus-temp').removeClass('focus-temp');
|
1849 | 1849 | }
|
|
1943 | 1943 | scrollWidth = elWidth > this.$tableBody.width() ? getScrollBarWidth() : 0;
|
1944 | 1944 |
|
1945 | 1945 | this.$tableFooter.css({
|
1946 |
| - 'margin-right': scrollWidth |
1947 |
| - }).find('table').css('width', elWidth) |
| 1946 | + 'margin-right': scrollWidth |
| 1947 | + }).find('table').css('width', elWidth) |
1948 | 1948 | .attr('class', this.$el.attr('class'));
|
1949 | 1949 |
|
1950 | 1950 | $footerTd = this.$tableFooter.find('td');
|
|
2403 | 2403 | };
|
2404 | 2404 |
|
2405 | 2405 | BootstrapTable.prototype.getHiddenColumns = function () {
|
2406 |
| - return $.grep(this.columns, function( column ) { |
| 2406 | + return $.grep(this.columns, function (column) { |
2407 | 2407 | return !column.visible;
|
2408 | 2408 | });
|
2409 | 2409 | };
|
|
0 commit comments