8000 Fix export lint · pythonAI/bootstrap-table@3b515b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3b515b3

Browse filesBrowse files
committed
Fix export lint
1 parent 57915af commit 3b515b3

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

src/extensions/export/bootstrap-table-export.js

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
})
3838

3939
$.extend($.fn.bootstrapTable.locales, {
40-
formatExport() {
40+
formatExport () {
4141
return 'Export data'
4242
}
4343
})
@@ -82,10 +82,10 @@
8282
const types = exportTypes.slice(1, -1).replace(/ /g, '').split(',')
8383
exportTypes = types.map(t => t.slice(1, -1))
8484
}
85-
for (type of exportTypes) {
85+
for (let type of exportTypes) {
8686
if (TYPE_NAME.hasOwnProperty(type)) {
87-
const item = utils.bootstrapVersion === 4 ?
88-
TYPE_NAME[type] : `<a href="javascript:void(0)">${TYPE_NAME[type]}</a>`
87+
const item = utils.bootstrapVersion === 4
88+
? TYPE_NAME[type] : `<a href="javascript:void(0)">${TYPE_NAME[type]}</a>`
8989
const $item = $(utils.sprintf(utils.bs.toobarDropdowItemHtml, item))
9090
$item.attr('data-type', type)
9191
$menu.append($item)
@@ -95,17 +95,15 @@
9595
$menu.find('>li, >label').click(e => {
9696
const type = $(e.currentTarget).data('type')
9797
const doExport = () => {
98+
const data = this.getData()
9899
if (o.exportFooter) {
99-
const data = this.getData()
100100
const $footerRow = this.$tableFooter.find('tr').first()
101-
102101
const footerData = {}
103102
const footerHtml = []
104103

105-
$.each($footerRow.children(), function(index, footerCell) {
106-
107-
var footerCellHtml = $(footerCell).children(".th-inner").first().html()
108-
footerData[this.columns[index].field] = footerCellHtml == '&nbsp;' ? null : footerCellHtml
104+
$.each($footerRow.children(), function (index, footerCell) {
105+
var footerCellHtml = $(footerCell).children('.th-inner').first().html()
106+
footerData[this.columns[index].field] = footerCellHtml === '&nbsp;' ? null : footerCellHtml
109107

110108
// grab footer cell text into cell index-based array
111109
footerHtml.push(footerCellHtml)
@@ -115,8 +113,7 @@
115113

116114
var $lastTableRow = this.$body.children().last()
117115

118-
$.each($lastTableRow.children(), function(index, lastTableRowCell) {
119-
116+
$.each($lastTableRow.children(), function (index, lastTableRowCell) {
120117
$(lastTableRowCell).html(footerHtml[index])
121118
})
122119
}
@@ -143,8 +140,8 @@
143140
})
144141
this.togglePagination()
145142
} else if (o.exportDataType === 'selected') {
146-
const data = this.getData()
147-
const selectedData = this.getSelections()
143+
let data = this.getData()
144+
let selectedData = this.getSelections()
148145
if (!selectedData.length) {
149146
return
150147
}
@@ -178,5 +175,4 @@
178175
})
179176
}
180177
}
181-
182178
})(jQuery)

0 commit comments

Comments
 (0)
0