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: {
|
||||
overviewLoaded() {
|
||||
this.fetchData()
|
||||
|
||||
this.getSidebarHeight()
|
||||
},
|
||||
summonerFound() {
|
||||
this.fetchData()
|
||||
// Set default value when the summoner changes
|
||||
this.fixedSidebar = false
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.fetchData()
|
||||
window.addEventListener('scroll', this.handleScroll)
|
||||
window.addEventListener('scroll', this.isSidebarFixed)
|
||||
},
|
||||
|
||||
mounted() {
|
||||
|
|
@ -93,7 +93,7 @@ export default {
|
|||
},
|
||||
|
||||
destroyed() {
|
||||
window.removeEventListener('scroll', this.handleScroll)
|
||||
window.removeEventListener('scroll', this.isSidebarFixed)
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
@ -105,9 +105,10 @@ export default {
|
|||
getSidebarHeight() {
|
||||
this.$nextTick(() => {
|
||||
this.sidebarRectangle.height = this.$refs.sidebar ? this.$refs.sidebar.getBoundingClientRect().height : null
|
||||
this.isSidebarFixed()
|
||||
})
|
||||
},
|
||||
handleScroll() {
|
||||
isSidebarFixed() {
|
||||
if (!this.sidebarRectangle.height) return
|
||||
this.fixedSidebar = window.innerHeight + document.documentElement.scrollTop > this.sidebarRectangle.y + this.sidebarRectangle.height + 112
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue