fix: sidebar glitch effect with Firefox

This commit is contained in:
Valentin Kaelin 2020-04-22 23:44:38 +02:00
parent f4d183fade
commit fb57006b0d

View file

@ -108,7 +108,7 @@ export default {
if (this.isMobile) return if (this.isMobile) return
this.$nextTick(() => { this.$nextTick(() => {
this.sidebarRectangle.height = this.$refs.sidebar ? this.$refs.sidebar.getBoundingClientRect().height : null this.sidebarRectangle.height = this.$refs.sidebar ? Math.ceil(this.$refs.sidebar.getBoundingClientRect().height) : null
this.isSidebarFixed() this.isSidebarFixed()
}) })
}, },
@ -124,8 +124,8 @@ export default {
}, },
isSidebarFixed() { isSidebarFixed() {
if (this.isMobile) return if (this.isMobile) return
if (!this.sidebarRectangle.height) return if (!this.sidebarRectangle.height) return
this.fixedSidebar = window.innerHeight + document.documentElement.scrollTop > this.sidebarRectangle.y + this.sidebarRectangle.height + 123 this.fixedSidebar = window.innerHeight + document.documentElement.scrollTop > this.sidebarRectangle.y + this.sidebarRectangle.height + 123
}, },
...mapActions('summoner', ['moreMatches', 'overviewRequest']), ...mapActions('summoner', ['moreMatches', 'overviewRequest']),