mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2025-01-20 01:40:41 +00:00
Disable scrolling while the user / room list overlay is open
This commit is contained in:
parent
f85699b314
commit
8e2bb52fc6
@ -37,6 +37,7 @@ define([
|
||||
return
|
||||
}
|
||||
|
||||
this.mobile = false
|
||||
this.open = false
|
||||
this.sidebar = document.querySelector('.sidebar')
|
||||
|
||||
@ -48,6 +49,7 @@ define([
|
||||
}
|
||||
|
||||
enableMobile() {
|
||||
this.mobile = true
|
||||
this.element.parentElement.hidden = false
|
||||
}
|
||||
|
||||
@ -57,6 +59,7 @@ define([
|
||||
}
|
||||
|
||||
this.element.parentElement.hidden = true
|
||||
this.mobile = false
|
||||
}
|
||||
|
||||
show(doShow = true) {
|
||||
@ -75,6 +78,10 @@ define([
|
||||
this.roomList.appendChild(this.closeButton)
|
||||
|
||||
this.roomList.dataset.show = 'true'
|
||||
|
||||
if (this.mobile) {
|
||||
UiScreen.scrollDisable()
|
||||
}
|
||||
}
|
||||
else {
|
||||
delete this.roomList.dataset.show
|
||||
@ -86,6 +93,10 @@ define([
|
||||
|
||||
this.sidebar.style.removeProperty('display')
|
||||
this.open = false
|
||||
|
||||
if (this.mobile) {
|
||||
UiScreen.scrollEnable()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@ define([
|
||||
constructor(element, ...superDeps) {
|
||||
super(element, ...superDeps)
|
||||
|
||||
this.mobile = false
|
||||
this.open = false
|
||||
this.userList = document.getElementById('chatUserList')
|
||||
this.sidebar = document.querySelector('.sidebar')
|
||||
@ -43,6 +44,7 @@ define([
|
||||
}
|
||||
|
||||
enableMobile() {
|
||||
this.mobile = true
|
||||
this.element.parentElement.hidden = false
|
||||
}
|
||||
|
||||
@ -52,6 +54,7 @@ define([
|
||||
}
|
||||
|
||||
this.element.parentElement.hidden = true
|
||||
this.mobile = false
|
||||
}
|
||||
|
||||
show(doShow = true) {
|
||||
@ -70,6 +73,10 @@ define([
|
||||
this.userList.appendChild(this.closeButton)
|
||||
|
||||
this.userList.dataset.show = 'true'
|
||||
|
||||
if (this.mobile) {
|
||||
UiScreen.scrollDisable()
|
||||
}
|
||||
}
|
||||
else {
|
||||
delete this.userList.dataset.show
|
||||
@ -81,6 +88,10 @@ define([
|
||||
|
||||
this.sidebar.style.removeProperty('display')
|
||||
this.open = false
|
||||
|
||||
if (this.mobile) {
|
||||
UiScreen.scrollEnable()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user