mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
fix: season selector works again in overview tab
This commit is contained in:
parent
a5d5eb857c
commit
fae3c08ad0
1 changed files with 6 additions and 5 deletions
|
|
@ -74,18 +74,18 @@ export default {
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
overviewLoaded() {
|
overviewLoaded() {
|
||||||
|
this.fetchData()
|
||||||
|
|
||||||
this.getSidebarHeight()
|
this.getSidebarHeight()
|
||||||
},
|
},
|
||||||
summonerFound() {
|
summonerFound() {
|
||||||
this.fetchData()
|
this.fetchData()
|
||||||
// Set default value when the summoner changes
|
|
||||||
this.fixedSidebar = false
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.fetchData()
|
this.fetchData()
|
||||||
window.addEventListener('scroll', this.handleScroll)
|
window.addEventListener('scroll', this.isSidebarFixed)
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
@ -93,7 +93,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
destroyed() {
|
destroyed() {
|
||||||
window.removeEventListener('scroll', this.handleScroll)
|
window.removeEventListener('scroll', this.isSidebarFixed)
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -105,9 +105,10 @@ export default {
|
||||||
getSidebarHeight() {
|
getSidebarHeight() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.sidebarRectangle.height = this.$refs.sidebar ? this.$refs.sidebar.getBoundingClientRect().height : null
|
this.sidebarRectangle.height = this.$refs.sidebar ? this.$refs.sidebar.getBoundingClientRect().height : null
|
||||||
|
this.isSidebarFixed()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleScroll() {
|
isSidebarFixed() {
|
||||||
if (!this.sidebarRectangle.height) return
|
if (!this.sidebarRectangle.height) return
|
||||||
this.fixedSidebar = window.innerHeight + document.documentElement.scrollTop > this.sidebarRectangle.y + this.sidebarRectangle.height + 112
|
this.fixedSidebar = window.innerHeight + document.documentElement.scrollTop > this.sidebarRectangle.y + this.sidebarRectangle.height + 112
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue