From 0448214abd97b9d4af4131c046291d1e90a256d8 Mon Sep 17 00:00:00 2001 From: An Phan Date: Thu, 24 Nov 2016 16:50:22 +0800 Subject: [PATCH] Turn volume into a component --- .../js/components/site-footer/index.vue | 50 ++------------- .../js/components/site-footer/volume.vue | 61 +++++++++++++++++++ 2 files changed, 65 insertions(+), 46 deletions(-) create mode 100644 resources/assets/js/components/site-footer/volume.vue diff --git a/resources/assets/js/components/site-footer/index.vue b/resources/assets/js/components/site-footer/index.vue index f74edab0..37ab3549 100644 --- a/resources/assets/js/components/site-footer/index.vue +++ b/resources/assets/js/components/site-footer/index.vue @@ -42,20 +42,13 @@ v-if="useEqualizer" @click="showEqualizer = !showEqualizer" :class="{ active: showEqualizer }"/> - + - - - - - + @@ -70,12 +63,12 @@ import { songStore, favoriteStore, preferenceStore } from '../../stores'; import soundBar from '../shared/sound-bar.vue'; import equalizer from './equalizer.vue'; +import volume from './volume.vue'; export default { data() { return { song: songStore.stub, - muted: false, viewingQueue: false, prefs: preferenceStore.state, @@ -91,7 +84,7 @@ export default { }; }, - components: { soundBar, equalizer }, + components: { soundBar, equalizer, volume }, computed: { /** @@ -114,24 +107,6 @@ export default { }, methods: { - /** - * Mute the volume. - */ - mute() { - this.muted = true; - - return playback.mute(); - }, - - /** - * Unmute the volume. - */ - unmute() { - this.muted = false; - - return playback.unmute(); - }, - /** * Play the previous song in queue. */ @@ -494,21 +469,4 @@ export default { } } } - -#volume { - @include vertical-center(); - - // More tweaks - input[type=range] { - margin-top: -3px; - } - - i { - width: 16px; - } - - @media only screen and (max-width: 768px) { - display: none !important; - } -} diff --git a/resources/assets/js/components/site-footer/volume.vue b/resources/assets/js/components/site-footer/volume.vue new file mode 100644 index 00000000..7cc17f47 --- /dev/null +++ b/resources/assets/js/components/site-footer/volume.vue @@ -0,0 +1,61 @@ + + + + +