Fix login menu

This commit is contained in:
Bartek Fabiszewski 2019-07-29 09:00:03 +02:00
parent e140dba63c
commit ca53f98c25
3 changed files with 5 additions and 7 deletions

View File

@ -331,8 +331,6 @@ button > * {
padding-top: .5em;
}
.show { display: block; }
.icon { height: 1.4em; }
.menu-title { text-decoration: underline; }

File diff suppressed because one or more lines are too long

View File

@ -421,10 +421,10 @@ export default class uUI {
* Toggle user menu visibility
*/
showUserMenu() {
if (this.userDropdown.classList.contains('show')) {
this.userDropdown.classList.remove('show');
if (this.userDropdown.style.display === 'block') {
this.userDropdown.style.display = 'none';
} else {
this.userDropdown.classList.add('show');
this.userDropdown.style.display = 'block';
window.addEventListener('click', this.hideUserMenu, true);
}
}
@ -435,7 +435,7 @@ export default class uUI {
*/
hideUserMenu(e) {
const parent = e.target.parentElement;
this.userDropdown.classList.remove('show');
this.userDropdown.style.display = 'none';
window.removeEventListener('click', this.hideUserMenu, true);
if (!parent.classList.contains('dropdown')) {
e.stopPropagation();