forked from platypush/platypush
Don't store/show the state of write-only toggle switches
This commit is contained in:
parent
8cd5cb3338
commit
3e6ebdd23b
1 changed files with 12 additions and 2 deletions
|
@ -11,8 +11,11 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-2 switch pull-right">
|
<div class="col-2 switch pull-right">
|
||||||
<ToggleSwitch :value="value.state" @input="toggle"
|
<ToggleSwitch
|
||||||
@click.stop :disabled="loading || value.is_read_only" />
|
:value="value.is_write_only ? false : value.state"
|
||||||
|
:disabled="loading || value.is_read_only"
|
||||||
|
@input="toggle"
|
||||||
|
@click.stop />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -38,6 +41,13 @@ export default {
|
||||||
id: this.value.id,
|
id: this.value.id,
|
||||||
action: 'toggle',
|
action: 'toggle',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (this.value.is_write_only) {
|
||||||
|
// Show a quick on/off animation for write-only switches
|
||||||
|
const self = this
|
||||||
|
self.value.state = true
|
||||||
|
setTimeout(() => self.value.state = false, 250)
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
this.$emit('loading', false)
|
this.$emit('loading', false)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue