fix: chatbox height
This commit is contained in:
parent
84209c3ff3
commit
9b5a12d10e
@ -1,5 +1,6 @@
|
|||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
const resizeChat = () => {
|
const resizeChat = () => {
|
||||||
|
let isMobile = window.innerHeight < 993;
|
||||||
let chatBox = Array.from(document.querySelectorAll("solid-xmpp-chat"))
|
let chatBox = Array.from(document.querySelectorAll("solid-xmpp-chat"))
|
||||||
.map((el) => el.shadowRoot ? el.shadowRoot.getElementById("conversejs") : false)
|
.map((el) => el.shadowRoot ? el.shadowRoot.getElementById("conversejs") : false)
|
||||||
.filter((el) => el)
|
.filter((el) => el)
|
||||||
@ -21,7 +22,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||||||
let headerOffset = document.querySelector('#header').offsetHeight;
|
let headerOffset = document.querySelector('#header').offsetHeight;
|
||||||
let intermediateOffset = Array.from(document.querySelectorAll(".content-box__header")).filter(el=>el.offsetParent!==null?el:null)[0].offsetHeight;
|
let intermediateOffset = Array.from(document.querySelectorAll(".content-box__header")).filter(el=>el.offsetParent!==null?el:null)[0].offsetHeight;
|
||||||
viewportChat.forEach(
|
viewportChat.forEach(
|
||||||
(c) => (c.style.height = "calc(100vh - "+String(headerOffset+intermediateOffset)+"px)") // Firefox keyboard 57px
|
(c) => (c.style.height = isMobile ? "calc(100vh - "+String(headerOffset+intermediateOffset)+"px - 57px)" : "calc(100vh - "+String(headerOffset+intermediateOffset)+"px)")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user