<div class="notificationSettingsEmail">
{if $event->supportsEmailNotification()}
<input type="hidden" id="settings_{$event->eventID}_mailNotificationType" name="settings[{@$event->eventID}][mailNotificationType]" value="{$settings[$event->eventID][mailNotificationType]}">
- <a href="#" class="notificationSettingsEmailType jsTooltip{if $settings[$event->eventID][enabled]|empty} disabled{/if}" role="button" title="{lang}wcf.user.notification.mailNotificationType.{@$settings[$event->eventID][mailNotificationType]}{/lang}" data-object-id="{@$event->eventID}">
+ <button class="notificationSettingsEmailType jsTooltip{if $settings[$event->eventID][enabled]|empty} disabled{/if}" title="{lang}wcf.user.notification.mailNotificationType.{@$settings[$event->eventID][mailNotificationType]}{/lang}" data-object-id="{@$event->eventID}">
<span class="jsIconNotificationSettingsEmailType">
{if $settings[$event->eventID][mailNotificationType] === 'none'}
{icon size=24 name='xmark' type='solid'}
{/if}
</span>
{icon size=16 name='caret-down' type='solid'}
- </a>
+ </button>
{/if}
</div>
</div>
}
private buildButton(button: UserMenuButton): HTMLElement {
- const link = document.createElement("a");
- link.setAttribute("role", "button");
+ let link: HTMLAnchorElement | HTMLButtonElement;
+ if (button.link === "#") {
+ link = document.createElement("button");
+ } else {
+ link = document.createElement("a");
+ link.href = button.link;
+ }
+
link.classList.add("userMenuButton", "jsTooltip");
link.title = button.title;
link.innerHTML = button.icon;
if (button.name === "markAllAsRead") {
- link.href = "#";
link.addEventListener("click", (event) => {
event.preventDefault();
void this.markAllAsRead();
});
- } else {
- link.href = button.link;
}
return link;
}
}
buildButton(button) {
- const link = document.createElement("a");
- link.setAttribute("role", "button");
+ let link;
+ if (button.link === "#") {
+ link = document.createElement("button");
+ }
+ else {
+ link = document.createElement("a");
+ link.href = button.link;
+ }
link.classList.add("userMenuButton", "jsTooltip");
link.title = button.title;
link.innerHTML = button.icon;
if (button.name === "markAllAsRead") {
- link.href = "#";
link.addEventListener("click", (event) => {
event.preventDefault();
void this.markAllAsRead();
});
}
- else {
- link.href = button.link;
- }
return link;
}
async markAllAsRead() {
.userMenuButton {
align-items: center;
+ color: inherit;
display: flex;
height: 44px;
justify-content: center;
width: 44px;
+
+ &:hover {
+ color: inherit;
+ }
}
html:not(.touch) .userMenuButton {