diff --git a/.gitignore b/.gitignore index 360919c..f7696fe 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,4 @@ /www/scripts/ /www/lib/ /www/oidc-client-config.json -!/www/lib/sib-core -!/www/lib/sib-router -!/www/lib/sib-chat -!/www/lib/sib-oidc *.iml \ No newline at end of file diff --git a/src/dependencies.pug b/src/dependencies.pug index 1e61912..7793f96 100644 --- a/src/dependencies.pug +++ b/src/dependencies.pug @@ -3,10 +3,7 @@ //script(src="/lib/webcomponentsjs/webcomponents-loader.js") //- script(src="lib/html-imports.js") -script( - type="module" - src="https://unpkg.com/@startinblox/oidc@0.5" -) +script(type="module" src="https://unpkg.com/@startinblox/oidc@0.5") script(src="/scripts/index.js") diff --git a/src/header.pug b/src/header.pug index c89e0d6..6aced93 100644 --- a/src/header.pug +++ b/src/header.pug @@ -12,11 +12,15 @@ sib-notifications( bind-user ) +sib-widget(name="user-picture") + template + img(name="${name}",src="\${value || '/images/user.jpg'}",style="max-width:100%; max-height: 100%;") + details#user-controls summary(tabindex='0' role='button') sib-display#user-controls__profile( data-fields='first_name, account.picture', - widget-account.picture='sib-display-img', + widget-account.picture='user-picture', bind-user ) #user-controls__panel diff --git a/src/scripts/index.js b/src/scripts/index.js index dc79031..9b4fac6 100644 --- a/src/scripts/index.js +++ b/src/scripts/index.js @@ -6,12 +6,6 @@ document.addEventListener('DOMContentLoaded', function (event) { if (!navBar || !btnToggle) return; - document.querySelectorAll('img[name$="account.picture"]').forEach(function (e) { - if (!e.src || e.src == window.location) { - e.src = '/images/user.jpg'; - } - }); - btnToggle.addEventListener('click', e => { navBar.classList.toggle('open'); e.stopPropagation();