Prevent multi-click for grid filters "Save Defaults" button
This commit is contained in:
parent
0d9c5a078b
commit
b37981e83f
|
@ -357,6 +357,8 @@
|
|||
loading: false,
|
||||
ajaxDataUrl: ${json.dumps(grid.ajax_data_url)|n},
|
||||
|
||||
savingDefaults: false,
|
||||
|
||||
data: ${grid.component_studly}CurrentData,
|
||||
rowStatusMap: ${json.dumps(grid_data['row_status_map'])|n},
|
||||
|
||||
|
@ -589,6 +591,7 @@
|
|||
this.firstItem = data.first_item
|
||||
this.lastItem = data.last_item
|
||||
this.loading = false
|
||||
this.savingDefaults = false
|
||||
this.checkedRows = this.locateCheckedRows(data.checked_rows)
|
||||
if (success) {
|
||||
success()
|
||||
|
@ -600,6 +603,7 @@
|
|||
duration: 2000, // 4 seconds
|
||||
})
|
||||
this.loading = false
|
||||
this.savingDefaults = false
|
||||
if (failure) {
|
||||
failure()
|
||||
}
|
||||
|
@ -609,6 +613,7 @@
|
|||
this.data = []
|
||||
this.total = 0
|
||||
this.loading = false
|
||||
this.savingDefaults = false
|
||||
if (failure) {
|
||||
failure()
|
||||
}
|
||||
|
@ -805,6 +810,7 @@
|
|||
},
|
||||
|
||||
saveDefaults() {
|
||||
this.savingDefaults = true
|
||||
|
||||
// apply current filters as normal, but add special directive
|
||||
this.applyFilters({'save-current-filters-as-defaults': true})
|
||||
|
|
|
@ -60,8 +60,9 @@
|
|||
<b-button @click="saveDefaults()"
|
||||
icon-pack="fas"
|
||||
icon-left="save"
|
||||
class="control">
|
||||
Save Defaults
|
||||
class="control"
|
||||
:disabled="savingDefaults">
|
||||
{{ savingDefaults ? "Working, please wait..." : "Save Defaults" }}
|
||||
</b-button>
|
||||
% endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue