Skip to content

Commit

Permalink
fix(store): fix overflow toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
raulghm committed May 24, 2019
1 parent 1a24386 commit b380946
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/views/Store.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export default {
beforeDestroy () {
this.$store.commit('setInStore', false)
this.setBodyOverflow()
},
apollo: {
Expand Down Expand Up @@ -170,14 +171,16 @@ export default {
toggleFullScreenMap () {
this.isFullScreenMap = !this.isFullScreenMap
this.setBodyOverflow(this.isFullScreenMap)
window.scrollTo(0, 0)
},
if (this.isFullScreenMap === true) {
document.getElementsByTagName('body')[0].style.overflow = 'hidden'
setBodyOverflow (value) {
if (value) {
document.querySelector('body').style.overflow = 'hidden'
} else {
document.getElementsByTagName('body')[0].style.overflow = 'auto'
document.querySelector('body').style.overflow = 'auto'
}
window.scrollTo(0, 0)
}
}
}
Expand Down

0 comments on commit b380946

Please sign in to comment.