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

Commit

Permalink
fix(chapters): remove wrong click guard on onChapterClick, change to …
Browse files Browse the repository at this point in the history
…use linkHover state to guard to be in line with what is displayed
  • Loading branch information
monkeydom committed Sep 6, 2018
1 parent 46626c7 commit 8e3a3e0
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/components/tabs/chapters/ChapterEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@mouseover="onMouseOver"
@mouseleave="onMouseLeave">
<span class="index" v-if="hover" @click="onChapterPlayClick" aria-hidden="true">
<link-icon size="20" :color="theme.tabs.body.icon" v-if="linkhover"></link-icon>
<link-icon size="20" :color="theme.tabs.body.icon" v-if="linkHover"></link-icon>
<play-icon size="12" :color="theme.tabs.body.icon" v-else></play-icon>
</span>

Expand Down Expand Up @@ -55,7 +55,8 @@
data () {
return {
...this.mapState('theme', 'playtime', 'ghost', 'runtime'),
hover: false
hover: false,
linkHover: false
}
},
Expand Down Expand Up @@ -134,11 +135,11 @@
},
onMouseOverLink () {
this.linkhover = true
this.linkHover = true
},
onMouseLeaveLink () {
this.linkhover = false
this.linkHover = false
},
...mapActions({
Expand All @@ -150,9 +151,6 @@
},
onChapterClick: function ({ dispatch, actions }, event) {
if (event.target.classList.contains('info-link')) {
return false
}
dispatch(actions.setChapter(this.chapter.index - 1))
dispatch(actions.updatePlaytime(this.ghost.time))
dispatch(actions.play())
Expand All @@ -161,7 +159,7 @@
},
onChapterPlayClick: function ({ dispatch, actions }, event) {
if (event.target.classList.contains('info-link')) {
if (this.linkHover) {
return false
}
dispatch(actions.setChapter(this.chapter.index - 1))
Expand Down

0 comments on commit 8e3a3e0

Please sign in to comment.