less javascript for user img
This commit is contained in:
parent
02d30beff8
commit
f60b720d37
4
.gitignore
vendored
4
.gitignore
vendored
@ -7,8 +7,4 @@
|
|||||||
/www/scripts/
|
/www/scripts/
|
||||||
/www/lib/
|
/www/lib/
|
||||||
/www/oidc-client-config.json
|
/www/oidc-client-config.json
|
||||||
!/www/lib/sib-core
|
|
||||||
!/www/lib/sib-router
|
|
||||||
!/www/lib/sib-chat
|
|
||||||
!/www/lib/sib-oidc
|
|
||||||
*.iml
|
*.iml
|
@ -3,10 +3,7 @@
|
|||||||
//script(src="/lib/webcomponentsjs/webcomponents-loader.js")
|
//script(src="/lib/webcomponentsjs/webcomponents-loader.js")
|
||||||
//- script(src="lib/html-imports.js")
|
//- script(src="lib/html-imports.js")
|
||||||
|
|
||||||
script(
|
script(type="module" src="https://unpkg.com/@startinblox/oidc@0.5")
|
||||||
type="module"
|
|
||||||
src="https://unpkg.com/@startinblox/oidc@0.5"
|
|
||||||
)
|
|
||||||
|
|
||||||
script(src="/scripts/index.js")
|
script(src="/scripts/index.js")
|
||||||
|
|
||||||
|
@ -12,11 +12,15 @@ sib-notifications(
|
|||||||
bind-user
|
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
|
details#user-controls
|
||||||
summary(tabindex='0' role='button')
|
summary(tabindex='0' role='button')
|
||||||
sib-display#user-controls__profile(
|
sib-display#user-controls__profile(
|
||||||
data-fields='first_name, account.picture',
|
data-fields='first_name, account.picture',
|
||||||
widget-account.picture='sib-display-img',
|
widget-account.picture='user-picture',
|
||||||
bind-user
|
bind-user
|
||||||
)
|
)
|
||||||
#user-controls__panel
|
#user-controls__panel
|
||||||
|
@ -6,12 +6,6 @@ document.addEventListener('DOMContentLoaded', function (event) {
|
|||||||
|
|
||||||
if (!navBar || !btnToggle) return;
|
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 => {
|
btnToggle.addEventListener('click', e => {
|
||||||
navBar.classList.toggle('open');
|
navBar.classList.toggle('open');
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
Loading…
Reference in New Issue
Block a user