diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-12-30 13:22:49 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2020-01-02 11:07:37 +0100 |
commit | 7320de184b9e783dad33d0fbb5e157917f682e3d (patch) | |
tree | f424c7b7a820bf6095950805730c88a033f7a475 /apps/workflowengine/src/components/Check.vue | |
parent | 75b217cf8ddc65a5e434268c6405b8f09c9a8a4e (diff) | |
download | nextcloud-server-7320de184b9e783dad33d0fbb5e157917f682e3d.tar.gz nextcloud-server-7320de184b9e783dad33d0fbb5e157917f682e3d.zip |
Refactor validity propagation
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/workflowengine/src/components/Check.vue')
-rw-r--r-- | apps/workflowengine/src/components/Check.vue | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/workflowengine/src/components/Check.vue b/apps/workflowengine/src/components/Check.vue index e447fbeb4bd..c15907852e8 100644 --- a/apps/workflowengine/src/components/Check.vue +++ b/apps/workflowengine/src/components/Check.vue @@ -25,7 +25,7 @@ class="option" @input="updateCheck" @valid="(valid=true) && validate()" - @invalid="(valid=false) && validate()" /> + @invalid="!(valid=false) && validate()" /> <input v-else v-model="check.value" type="text" @@ -111,7 +111,7 @@ export default { if (this.check.class === null) { this.$nextTick(() => this.$refs.checkSelector.$el.focus()) } - this.check.invalid = !this.validate() + this.validate() }, methods: { showDelete() { @@ -124,7 +124,8 @@ export default { if (this.currentOption && this.currentOption.validate) { this.valid = !!this.currentOption.validate(this.check) } - return this.valid + this.check.invalid = !this.valid + this.$emit('validate', this.valid) }, updateCheck() { const matchingOperator = this.operators.findIndex((operator) => this.check.operator === operator.operator) @@ -134,7 +135,7 @@ export default { this.check.class = this.currentOption.class this.check.operator = this.currentOperator.operator - this.check.invalid = !this.validate() + this.validate() this.$emit('update', this.check) }, |