diff --git a/src/components/hubl-reactivity.js b/src/components/hubl-reactivity.js index 2dc766c..400a4e2 100644 --- a/src/components/hubl-reactivity.js +++ b/src/components/hubl-reactivity.js @@ -11,21 +11,17 @@ export const HublReactivity = { this.subscribe(); } }, - dataSrc: { - type: String, - default: '', - callback: async function (value) { - this.resourceId = null; - if (this.nestedField) { - const resource = store.get(value) || await store.getData(value, this.context); - const nestedResource = await resource[this.nestedField] - this.resourceId = nestedResource ? nestedResource['@id'] : null; - } else { - this.resourceId = value; - } - this.subscribe(); - } - }, + }, + async fetchData(value) { + this.resourceId = null; + if (this.nestedField) { + const resource = store.get(value) || await store.getData(value, this.context); + const nestedResource = await resource[this.nestedField] + this.resourceId = nestedResource ? nestedResource['@id'] : null; + } else { + this.resourceId = value; + } + this.subscribe(); }, subscribe() { if (this.resourceId && this.targetSrc) { diff --git a/src/header.pug b/src/header.pug index bee875f..420990c 100644 --- a/src/header.pug +++ b/src/header.pug @@ -41,7 +41,7 @@ button.loggedIn(role='log in' onclick="document.querySelector('sib-auth').login( button.notLoggedIn.mobile-menu-icon.icon-menu#toggleMainMenu -sib-auth(style='display:none!important') +sib-auth(style='display:none!important', auto-login) sib-auth-provider( data-authority=`${authority}` data-id=`${authorityName || "authority"}` diff --git a/src/index.pug b/src/index.pug index 8365b4b..0fd12f3 100644 --- a/src/index.pug +++ b/src/index.pug @@ -31,11 +31,11 @@ html(lang="en") 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 diff --git a/src/locales/en.json b/src/locales/en.json index 16a6504..f5e83fe 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -15,12 +15,12 @@ "project": "project", "circle": "circle" }, - "dashboard": "Dahsboard", + "dashboard": "Dashboard", "events": "Events", "gov": "Governance", "resources": "Resources", "jobBoard": "Job offers", - "profileDirectory": "Members directory", + "profileDirectory": "Profiles directory", "projects": "Projects", "circles": "Circles", "messages": "Messages", diff --git a/src/scripts/firefox-scroll.js b/src/scripts/firefox-scroll.js index 5f62468..3b9bb18 100644 --- a/src/scripts/firefox-scroll.js +++ b/src/scripts/firefox-scroll.js @@ -1,5 +1,8 @@ document.addEventListener("DOMContentLoaded", () => { const resizeChat = () => { + 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")) .map((el) => el.shadowRoot ? el.shadowRoot.getElementById("conversejs") : false) .filter((el) => el) @@ -19,7 +22,7 @@ document.addEventListener("DOMContentLoaded", () => { document.querySelectorAll("#viewport .chat-view") ); viewportChat.forEach( - (c) => (c.style.height = "calc(100vh - 106px - 57px - 4px)") + (c) => (c.style.height = isMobile ? (isFirefox && isFirefoxMobile) ? "calc(100vh - 106px - 57px)" : "calc(100vh - 106px)" : "calc(100vh - 64px - 83px)") ); } } @@ -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", () => { diff --git a/src/scripts/login-element-visibility.js b/src/scripts/login-element-visibility.js index 3210e53..689dbb2 100644 --- a/src/scripts/login-element-visibility.js +++ b/src/scripts/login-element-visibility.js @@ -10,8 +10,6 @@ document.addEventListener("DOMContentLoaded", function () { document .querySelector('.loggedIn') .setAttribute("style", "display:none !important"); - } else { - document.querySelector('sib-auth').login(); } }); }); \ No newline at end of file diff --git a/src/scripts/register-sw.js b/src/scripts/register-sw.js index c479a12..5b375a8 100644 --- a/src/scripts/register-sw.js +++ b/src/scripts/register-sw.js @@ -1,11 +1,11 @@ -// if('serviceWorker' in navigator) { - // var refreshing; - // navigator.serviceWorker.addEventListener('controllerchange', () => { - // if (refreshing) { - // return; - // } - // refreshing = true; - // window.location.reload(); - // }); - // navigator.serviceWorker.register('/sw.js'); -// } \ No newline at end of file +if('serviceWorker' in navigator) { + var refreshing; + navigator.serviceWorker.addEventListener('controllerchange', () => { + if (refreshing) { + return; + } + refreshing = true; + window.location.reload(); + }); + navigator.serviceWorker.register('/sw.js'); +} \ No newline at end of file diff --git a/src/styles/layout/user/messages.scss b/src/styles/layout/user/messages.scss index f0ae1ec..db9e071 100644 --- a/src/styles/layout/user/messages.scss +++ b/src/styles/layout/user/messages.scss @@ -9,5 +9,8 @@ } .avatar-text { position: absolute; - top: 2.8rem; + top: 7.5rem; + @include breakpoint(lg) { + top: 2.8rem; + } } \ No newline at end of file