feature: enable no-render

This commit is contained in:
Jean-Baptiste Pasquier 2020-12-01 08:54:02 +01:00
commit a9bf3d8901
No known key found for this signature in database
GPG Key ID: CC04B91B949C163A
4 changed files with 26 additions and 19 deletions

View File

@ -65,6 +65,5 @@ script(data-default-context, type="application/ld+json")
| "object": "http://happy-dev.fr/owl/#object",
| "author": "http://happy-dev.fr/owl/#author",
| "account": "http://happy-dev.fr/owl/#account",
| "jabberID": "foaf:jabberID",
| "picture": "foaf:depiction"
| "jabberID": "foaf:jabberID"
| }

View File

@ -24,18 +24,18 @@ html(lang="en")
nav#main__menu.left-menu.jsLeftMenu
include menu-left.pug
main#viewport.content.notLoggedIn(no-render)
main#viewport.content.notLoggedIn
if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards)
#dashboard(hidden, data-view="dashboard").no-sidebar.with-padding
include page-dashboard.pug
if publicDirectory && (endpoints.users || (endpoints.get && endpoints.get.users))
#members(hidden, data-view="members").no-sidebar.with-padding
#members(hidden, data-view="members", no-render).no-sidebar.with-padding
include page-directory.pug
if endpoints.joboffers || (endpoints.get && endpoints.get.joboffers)
#job-offers(hidden, data-view="job-offers").no-sidebar.with-padding
#job-offers(hidden, data-view="job-offers", no-render).no-sidebar.with-padding
if (endpoints.post && endpoints.post.joboffers) && (endpoints.get && endpoints.get.joboffers)
hubl-reactivity(data-src=`${endpoints.post.joboffers}current/` target-src=`${endpoints.get.joboffers}`)
hubl-reactivity(data-src=`${endpoints.post.joboffers}expired/` target-src=`${endpoints.get.joboffers}`)
@ -49,7 +49,7 @@ html(lang="en")
include page-job-offers.pug
if endpoints.projects || (endpoints.get && endpoints.get.projects)
#project(hidden, data-view="project").with-sidebar
#project(hidden, data-view="project", no-render).with-sidebar
if (endpoints.post && endpoints.post.projects) && (endpoints.get && endpoints.get.projects)
hubl-reactivity(data-src=`${endpoints.post.projects}joinable/` target-src=`${endpoints.get.projects}`)
hubl-reactivity(data-src=`${endpoints.post.projects}` target-src=`${endpoints.get.projects}`)
@ -61,7 +61,7 @@ html(lang="en")
include page-project.pug
if endpoints.circles || (endpoints.get && endpoints.get.circles)
#circle(hidden, data-view="circle").with-sidebar
#circle(hidden, data-view="circle", no-render).with-sidebar
if (endpoints.post && endpoints.post.circles) && (endpoints.get && endpoints.get.circles)
hubl-reactivity(data-src=`${endpoints.post.circles}joinable/` target-src=`${endpoints.get.circles}`)
hubl-reactivity(data-src=`${endpoints.post.circles}` target-src=`${endpoints.get.circles}`)
@ -72,29 +72,29 @@ html(lang="en")
hubl-reactivity(bind-user nested-field="circles" target-src=`${endpoints.circles || endpoints.get.circles}joinable/`)
include page-circle.pug
if endpoints.users || (endpoints.get && endpoints.get.users)
#messages(hidden, data-view="messages").with-sidebar
#messages(hidden, data-view="messages", no-render).with-sidebar
include page-messages.pug
if endpoints.polls || (endpoints.get && endpoints.get.polls)
#polls(hidden, data-view="polls").with-sidebar
#polls(hidden, data-view="polls", no-render).with-sidebar
include page-polls.pug
if endpoints.events || (endpoints.get && endpoints.get.events)
#events(hidden, data-view="events")
#events(hidden, data-view="events", no-render)
include page-events.pug
if endpoints.resources || (endpoints.get && endpoints.get.resources)
#resources(hidden, data-view="resources")
#resources(hidden, data-view="resources", no-render)
include page-resources.pug
#admin(hidden, data-view="admin").with-sidebar
#admin(hidden, data-view="admin", no-render).with-sidebar
include page-admin.pug
#about(data-view="about").no-sidebar.with-padding
#about(data-view="about", no-render).no-sidebar.with-padding
include page-about.pug
if (endpoints.skills || (endpoints.get && endpoints.get.skills)) && (endpoints.uploads || (endpoints.post && endpoints.post.uploads)) && (endpoints.users || (endpoints.post && endpoints.post.users))
#profile(hidden, data-view="profile").no-sidebar
#profile(hidden, data-view="profile", no-render).no-sidebar
include page-profile.pug
if analytics

View File

@ -1,5 +1,6 @@
document.addEventListener("DOMContentLoaded", () => {
const resizeChat = () => {
let isMobile = window.innerHeight < 993;
let chatBox = Array.from(document.querySelectorAll("solid-xmpp-chat"))
.map((el) => el.shadowRoot ? el.shadowRoot.getElementById("conversejs") : false)
.filter((el) => el)
@ -18,8 +19,10 @@ document.addEventListener("DOMContentLoaded", () => {
let viewportChat = Array.from(
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(
(c) => (c.style.height = "calc(100vh - 106px - 57px - 4px)")
(c) => (c.style.height = isMobile ? "calc(100vh - "+String(headerOffset+intermediateOffset)+"px - 57px)" : "calc(100vh - "+String(headerOffset+intermediateOffset)+"px)")
);
}
}
@ -33,7 +36,7 @@ document.addEventListener("DOMContentLoaded", () => {
clearInterval(isbody);
resizeChat();
}
}, 15);
}, 50);
window.addEventListener("load", () => {
setTimeout(() => {
@ -41,10 +44,12 @@ document.addEventListener("DOMContentLoaded", () => {
}, 0);
});
let windowResizing;
window.addEventListener("resize", () => {
setTimeout(() => {
windowResizing = setTimeout(() => {
clearInterval(windowResizing);
resizeChat();
}, 0);
}, 50);
});
document.addEventListener("navigate", () => {

View File

@ -9,5 +9,8 @@
}
.avatar-text {
position: absolute;
top: 7.5rem;
@include breakpoint(lg) {
top: 2.8rem;
}
}