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/lib/
|
||||
/www/oidc-client-config.json
|
||||
!/www/lib/sib-core
|
||||
!/www/lib/sib-router
|
||||
!/www/lib/sib-chat
|
||||
!/www/lib/sib-oidc
|
||||
*.iml
|
@ -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")
|
||||
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user