Skip to content

Commit

Permalink
Removed resetWidth method (wenzhixin#4687)
Browse files Browse the repository at this point in the history
  • Loading branch information
wenzhixin authored and djhvscf committed Nov 7, 2019
1 parent 43671df commit d701d35
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 23 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
ChangeLog
---------

### 1.15.6

- **Update:** Removed `resetWidth` method and use `resetView` instead.

### 1.15.5

- **New:** Added `jqXHR` for `responseHandler` option and `onLoadSuccess` event.
Expand Down
8 changes: 0 additions & 8 deletions site/docs/api/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,14 +426,6 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter)`.

- **Example:** [Reset View](https://examples.bootstrap-table.com/#methods/reset-view.html)

## resetWidth

- **Parameter:** `undefined`

- **Detail:**

Resizes header and footer to fit current columns width.

## showLoading

- **Parameter:** `undefined`
Expand Down
11 changes: 1 addition & 10 deletions src/bootstrap-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ class BootstrapTable {
this.$tableLoading.css('top', this.$header.outerHeight() + 1)
// Assign the correct sortable arrow
this.getCaret()
$(window).on(resizeEvent, e => this.resetWidth(e))
$(window).on(resizeEvent, () => this.resetView())
}

this.$selectAll = this.$header.find('[name="btSelectAll"]')
Expand Down Expand Up @@ -2618,15 +2618,6 @@ class BootstrapTable {
this.trigger('reset-view')
}

resetWidth () {
if (this.options.showHeader && this.options.height) {
this.fitHeader()
}
if (this.options.showFooter && !this.options.cardView) {
this.fitFooter()
}
}

showLoading () {
this.$tableLoading.css('display', 'flex')
}
Expand Down
2 changes: 1 addition & 1 deletion src/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ const METHODS = [
'checkBy', 'uncheckBy',
'refresh',
'destroy',
'resetView', 'resetWidth',
'resetView',
'showLoading', 'hideLoading',
'togglePagination', 'toggleFullscreen', 'toggleView',
'resetSearch',
Expand Down
5 changes: 1 addition & 4 deletions tools/check-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ class Methods extends API {
this.file = 'methods.md'
this.options = Constants.METHODS
this.attributes = ['Parameter', 'Detail', 'Example']
this.ignore = {
resetWidth: ['Example']
}
}
}

Expand Down Expand Up @@ -118,4 +115,4 @@ if (errorSum === 0) {
process.exit(0)
}

process.exit(1)
process.exit(1)

0 comments on commit d701d35

Please sign in to comment.