fix volume actually not getting animated

This commit is contained in:
Tomáš Mládek 2020-01-12 21:10:14 +01:00
parent 336a637b9f
commit e5b5ba12e0
2 changed files with 3 additions and 2 deletions

View file

@ -2,7 +2,7 @@
<div :class="['channel', `channel-${loadingState}`]"> <div :class="['channel', `channel-${loadingState}`]">
<div class="name">{{name}}</div> <div class="name">{{name}}</div>
<VolumeSlider :value="volume" :disabled="loadingState === 'unloaded'" <VolumeSlider :value="volume" :disabled="loadingState === 'unloaded'"
@maxValueChange="(actualValue) => {actualVolume = actualValue}"/> @valueChange="(actualValue) => {actualVolume = actualValue}"/>
<div class="title">{{loadingState === "loading" ? "Loading..." : title}}</div> <div class="title">{{loadingState === "loading" ? "Loading..." : title}}</div>
<div class="youtube-player" ref="ytpl"/> <div class="youtube-player" ref="ytpl"/>
</div> </div>

View file

@ -22,9 +22,10 @@ export default class Channel extends Vue {
this.onMaxValueChange(); this.onMaxValueChange();
} }
@Watch("value")
@Watch("maxValue") @Watch("maxValue")
private onMaxValueChange() { private onMaxValueChange() {
this.$emit("maxValueChange", this.value * (this.maxValue / 100), this.maxValue); this.$emit("valueChange", this.value * (this.maxValue / 100), this.maxValue);
} }
}; };
</script> </script>