mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
fix(search): remove overflow hidden when searching from homepage
This commit is contained in:
parent
b3b27d0223
commit
d1d61073c7
1 changed files with 19 additions and 11 deletions
|
|
@ -102,20 +102,11 @@ export default {
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
open(newVal) {
|
open(newVal) {
|
||||||
const header = document.querySelector('.header div')
|
|
||||||
// Search Dropdown open
|
// Search Dropdown open
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
if (!this.homepage) {
|
this.dropDownOpening()
|
||||||
document.body.style.marginLeft = `-${this.getScrollbarWidth()}px`
|
|
||||||
header.style.paddingRight = `${this.getScrollbarWidth()}px`
|
|
||||||
}
|
|
||||||
document.body.style.overflow = 'hidden'
|
|
||||||
} else {
|
} else {
|
||||||
if (!this.homepage) {
|
this.dropDownClosing()
|
||||||
header.style.paddingRight = 0
|
|
||||||
}
|
|
||||||
document.body.style.marginLeft = 0
|
|
||||||
document.body.style.overflow = 'auto'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
$route(newRoute) {
|
$route(newRoute) {
|
||||||
|
|
@ -136,9 +127,26 @@ export default {
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
window.removeEventListener('blur', this.windowBlur)
|
window.removeEventListener('blur', this.windowBlur)
|
||||||
window.removeEventListener('keydown', this.handleEscape)
|
window.removeEventListener('keydown', this.handleEscape)
|
||||||
|
this.dropDownClosing()
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
dropDownClosing() {
|
||||||
|
const header = document.querySelector('.header div')
|
||||||
|
if (!this.homepage && header) {
|
||||||
|
header.style.paddingRight = 0
|
||||||
|
}
|
||||||
|
document.body.style.marginLeft = 0
|
||||||
|
document.body.style.overflow = 'auto'
|
||||||
|
},
|
||||||
|
dropDownOpening() {
|
||||||
|
const header = document.querySelector('.header div')
|
||||||
|
if (!this.homepage) {
|
||||||
|
document.body.style.marginLeft = `-${this.getScrollbarWidth()}px`
|
||||||
|
header.style.paddingRight = `${this.getScrollbarWidth()}px`
|
||||||
|
}
|
||||||
|
document.body.style.overflow = 'hidden'
|
||||||
|
},
|
||||||
formSubmit() {
|
formSubmit() {
|
||||||
const search = this.summoner.split(' ').join('')
|
const search = this.summoner.split(' ').join('')
|
||||||
if (search.length) {
|
if (search.length) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue