Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Commit

Permalink
fix(Steppers): Steppers wrong state while playing
Browse files Browse the repository at this point in the history
- Fixes #336
  • Loading branch information
alexander-heimbuch committed Feb 6, 2017
1 parent 100e041 commit c05ecde
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/components/player/control-bar/StepBackButton.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<PodloveButton class="podlove-player--player-control" :class="playstate" :click="onButtonClick" :disabled="(playtime - 30) < 0">
<PodloveButton class="podlove-player--player-control" :class="playstate" :click="onButtonClick" :disabled="isDisabled(playtime)">
<StepBackIcon
:primary-color="theme.player.actions.icon"
:secondary-color="theme.player.actions.background"
Expand Down Expand Up @@ -27,6 +27,9 @@
methods: {
onButtonClick () {
store.dispatch(store.actions.updatePlaytime(this.$select('playtime') - 30))
},
isDisabled (playtime) {
return (Math.round(playtime, 1) - 30) < 0
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/components/player/control-bar/StepForwardButton.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<PodloveButton class="podlove-player--player-control" :class="playstate" :click="onButtonClick" :disabled="(playtime + 30) > duration">
<PodloveButton class="podlove-player--player-control" :class="playstate" :click="onButtonClick" :disabled="isDisabled(playtime, duration)">
<StepForwardIcon
:primary-color="theme.player.actions.icon"
:secondary-color="theme.player.actions.background"
Expand Down Expand Up @@ -28,6 +28,9 @@
methods: {
onButtonClick () {
store.dispatch(store.actions.updatePlaytime(this.$select('playtime') + 30))
},
isDisabled (playtime, duration) {
return (Math.round(playtime, 1) + 30) > Math.round(duration, 1)
}
}
}
Expand Down

0 comments on commit c05ecde

Please sign in to comment.