fix: no-render

This commit is contained in:
Jean-Baptiste Pasquier 2020-12-02 10:09:01 +01:00
parent f8624a06e8
commit 63e64b0ed6
No known key found for this signature in database
GPG Key ID: CC04B91B949C163A
2 changed files with 5 additions and 5 deletions

View File

@ -24,7 +24,7 @@ html(lang="en")
nav#main__menu.left-menu.jsLeftMenu nav#main__menu.left-menu.jsLeftMenu
include menu-left.pug include menu-left.pug
main#viewport.content.notLoggedIn(no-render) main#viewport.content.notLoggedIn
if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards)
#dashboard(hidden, data-view="dashboard").no-sidebar.with-padding #dashboard(hidden, data-view="dashboard").no-sidebar.with-padding

View File

@ -1,6 +1,8 @@
document.addEventListener("DOMContentLoaded", () => { document.addEventListener("DOMContentLoaded", () => {
const resizeChat = () => { const resizeChat = () => {
let isMobile = window.innerHeight < 993; let isMobile = window.innerWidth < 993;
let isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
let isFirefoxMobile = navigator.platform.toLowerCase().indexOf("mobile") > -1 || navigator.platform.toLowerCase().indexOf("tablet") > -1;
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)
@ -19,10 +21,8 @@ document.addEventListener("DOMContentLoaded", () => {
let viewportChat = Array.from( let viewportChat = Array.from(
document.querySelectorAll("#viewport .chat-view") document.querySelectorAll("#viewport .chat-view")
); );
let headerOffset = document.querySelector('#header').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 = isMobile ? "calc(100vh - "+String(headerOffset+intermediateOffset)+"px - 57px)" : "calc(100vh - "+String(headerOffset+intermediateOffset)+"px)") (c) => (c.style.height = isMobile ? (isFirefox && isFirefoxMobile) ? "calc(100vh - 106px - 57px)" : "calc(100vh - 106px)" : "calc(100vh - 64px - 83px)")
); );
} }
} }