Skip to content
Snippets Groups Projects
Commit a3e8ff61 authored by Neuber, Eugen Ramon's avatar Neuber, Eugen Ramon :speech_balloon: Committed by Reiter, Christoph
Browse files

Change chevron-up to -down on @blur

See issue #3
parent 9326dfa5
No related branches found
No related tags found
No related merge requests found
...@@ -353,13 +353,17 @@ class VPUAuth extends VPULitElement { ...@@ -353,13 +353,17 @@ class VPUAuth extends VPULitElement {
`; `;
} }
onDropdownClick(event) { setChevron(name) {
event.stopPropagation();
event.currentTarget.classList.toggle('is-active');
const chevron = this.shadowRoot.querySelector("#menu-chevron-icon"); const chevron = this.shadowRoot.querySelector("#menu-chevron-icon");
if (chevron !== null) { if (chevron !== null) {
chevron.name = event.currentTarget.classList.contains('is-active') ? 'chevron-up' : 'chevron-down'; chevron.name = name;
} }
}
onDropdownClick(event) {
event.stopPropagation();
event.currentTarget.classList.toggle('is-active');
this.setChevron(event.currentTarget.classList.contains('is-active') ? 'chevron-up' : 'chevron-down');
this.updateDropdownWidth(); this.updateDropdownWidth();
} }
...@@ -368,6 +372,7 @@ class VPUAuth extends VPULitElement { ...@@ -368,6 +372,7 @@ class VPUAuth extends VPULitElement {
dropdowns.forEach(function (el) { dropdowns.forEach(function (el) {
el.classList.remove('is-active'); el.classList.remove('is-active');
}); });
this.setChevron('chevron-down');
} }
onProfileClicked(event) { onProfileClicked(event) {
...@@ -385,7 +390,7 @@ class VPUAuth extends VPULitElement { ...@@ -385,7 +390,7 @@ class VPUAuth extends VPULitElement {
<vpu-icon name="chevron-down" id="menu-chevron-icon"></vpu-icon> <vpu-icon name="chevron-down" id="menu-chevron-icon"></vpu-icon>
</div> </div>
<div class="dropdown-menu" id="dropdown-menu2" role="menu"> <div class="dropdown-menu" id="dropdown-menu2" role="menu">
<div class="dropdown-content"> <div class="dropdown-content" @blur="${this.closeDropdown}">
${imageURL ? html`<img alt="" src="${imageURL}" class="dropdown-item">` : ''} ${imageURL ? html`<img alt="" src="${imageURL}" class="dropdown-item">` : ''}
<div class="menu"> <div class="menu">
${this.showProfile ? html`<a href="#" @click="${this.onProfileClicked}" class="dropdown-item">${i18n.t('profile')}</a>` :''} ${this.showProfile ? html`<a href="#" @click="${this.onProfileClicked}" class="dropdown-item">${i18n.t('profile')}</a>` :''}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment