diff --git a/CHANGELOG.md b/CHANGELOG.md index 944f8634c3..180dc0be3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/site/docs/api/methods.md b/site/docs/api/methods.md index 2d908c9f27..4bcaf492d7 100644 --- a/site/docs/api/methods.md +++ b/site/docs/api/methods.md @@ -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` diff --git a/src/bootstrap-table.js b/src/bootstrap-table.js index 01fa569c84..b9e0f34ed8 100644 --- a/src/bootstrap-table.js +++ b/src/bootstrap-table.js @@ -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"]') @@ -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') } diff --git a/src/constants/index.js b/src/constants/index.js index 4d3ccaf968..6e68ecae4a 100644 --- a/src/constants/index.js +++ b/src/constants/index.js @@ -441,7 +441,7 @@ const METHODS = [ 'checkBy', 'uncheckBy', 'refresh', 'destroy', - 'resetView', 'resetWidth', + 'resetView', 'showLoading', 'hideLoading', 'togglePagination', 'toggleFullscreen', 'toggleView', 'resetSearch', diff --git a/tools/check-api.js b/tools/check-api.js index e20a04e7ff..e16da0ebcb 100644 --- a/tools/check-api.js +++ b/tools/check-api.js @@ -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'] - } } } @@ -118,4 +115,4 @@ if (errorSum === 0) { process.exit(0) } -process.exit(1) \ No newline at end of file +process.exit(1)