Skip to content
Snippets Groups Projects
Commit 0bd9df44 authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier
Browse files

fix: firefox fix bottom bar

parent b5a267d8
No related branches found
No related tags found
1 merge request!224Release/firefox fix
Pipeline #8099 passed
document.addEventListener("DOMContentLoaded", () => { document.addEventListener("DOMContentLoaded", () => {
window.scrollTo(0, 1); const resizeChat = () => {
let scrollTop = 1; let chatBox = Array.from(document.querySelectorAll("solid-xmpp-chat"))
let fromTop = () => { .map((el) => el.shadowRoot ? el.shadowRoot.getElementById("conversejs") : false)
return window.pageYOffset || document.compatMode === "CSS1Compat" && document.documentElement.scrollTop || document.body.scrollTop || 0; .filter((el) => el)
.pop();
if (chatBox) {
let chatTextArea = chatBox.querySelector(".message-form-container");
let ischatTextArea = setInterval(() => {
chatTextArea = chatBox.querySelector(".message-form-container");
if (chatTextArea) {
clearInterval(ischatTextArea);
if (
chatBox.getBoundingClientRect().height -
chatTextArea.getBoundingClientRect().height !=
chatTextArea.offsetTop
) {
let viewportChat = Array.from(
document.querySelectorAll("#viewport .chat-view")
);
viewportChat.forEach(
(c) => (c.style.height = "calc(100vh - 106px - 57px - 4px)")
);
}
}
}, 15);
}
}; };
resizeChat();
let isbody = setInterval(() => { let isbody = setInterval(() => {
if (document.body) { if (document.body) {
clearInterval(isbody); clearInterval(isbody);
scrollTop = fromTop(); resizeChat();
window.scrollTo(0, scrollTop === 1 ? 0 : 1);
} }
}, 15); }, 15);
window.addEventListener("load", () => { window.addEventListener("load", () => {
setTimeout(() => { setTimeout(() => {
if (fromTop() < 20) { resizeChat();
window.scrollTo(0, scrollTop === 1 ? 0 : 1); }, 0);
} });
window.addEventListener("resize", () => {
setTimeout(() => {
resizeChat();
}, 0);
});
document.addEventListener("navigate", () => {
setTimeout(() => {
resizeChat();
}, 0); }, 0);
}); });
}); });
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment