Commit 8cc76ed9156bbb2fcc7cf51f48a700ecf97f15ea
Committed by
GitHub
Merge pull request #4151 from llnewuser/2.0
toggleSelectAll method should only operate on filtered data
Showing
1 changed file
with
4 additions
and
4 deletions
Show diff stats
src/components/transfer/list.vue
@@ -83,10 +83,10 @@ | @@ -83,10 +83,10 @@ | ||
83 | return (validKeysCount > 0 ? `${validKeysCount}/` : '') + `${this.data.length}`; | 83 | return (validKeysCount > 0 ? `${validKeysCount}/` : '') + `${this.data.length}`; |
84 | }, | 84 | }, |
85 | checkedAll () { | 85 | checkedAll () { |
86 | - return this.data.filter(data => !data.disabled).length === this.validKeysCount && this.validKeysCount !== 0; | 86 | + return this.filterData.filter(data => !data.disabled).length === this.validKeysCount && this.validKeysCount !== 0; |
87 | }, | 87 | }, |
88 | checkedAllDisabled () { | 88 | checkedAllDisabled () { |
89 | - return this.data.filter(data => !data.disabled).length <= 0; | 89 | + return this.filterData.filter(data => !data.disabled).length <= 0; |
90 | }, | 90 | }, |
91 | filterData () { | 91 | filterData () { |
92 | return this.showItems.filter(item => this.filterMethod(item, this.query)); | 92 | return this.showItems.filter(item => this.filterMethod(item, this.query)); |
@@ -118,8 +118,8 @@ | @@ -118,8 +118,8 @@ | ||
118 | }, | 118 | }, |
119 | toggleSelectAll (status) { | 119 | toggleSelectAll (status) { |
120 | const keys = status ? | 120 | const keys = status ? |
121 | - this.data.filter(data => !data.disabled || this.checkedKeys.indexOf(data.key) > -1).map(data => data.key) : | ||
122 | - this.data.filter(data => data.disabled && this.checkedKeys.indexOf(data.key) > -1).map(data => data.key); | 121 | + this.filterData.filter(data => !data.disabled || this.checkedKeys.indexOf(data.key) > -1).map(data => data.key) : |
122 | + this.filterData.filter(data => data.disabled && this.checkedKeys.indexOf(data.key) > -1).map(data => data.key); | ||
123 | this.$emit('on-checked-keys-change', keys); | 123 | this.$emit('on-checked-keys-change', keys); |
124 | }, | 124 | }, |
125 | handleQueryClear () { | 125 | handleQueryClear () { |