this.openNotifications();
}
+ this.refreshTabUnreadIndicators();
this.refreshUnreadIndicator();
}
if (legacyPanel) {
legacyPanel.close();
}
+
+ this.refreshTabUnreadIndicators();
}
private attachViewToPanel(tab: Tab): void {
const tab = document.createElement("a");
tab.classList.add("pageMenuUserTab");
+ tab.dataset.hasUnreadContent = "false";
tab.dataset.origin = data.origin;
tab.id = tabId;
tab.setAttribute("aria-controls", panelId);
this.userMenu.classList.remove("pageMenuMobileButtonHasContent");
}
}
+
+ private refreshTabUnreadIndicators(): void {
+ this.userMenuProviders.forEach((provider, tab) => {
+ if (provider.hasUnreadContent()) {
+ tab.dataset.hasUnreadContent = "true";
+ } else {
+ tab.dataset.hasUnreadContent = "false";
+ }
+ });
+ }
}
export function hasValidUserMenu(): boolean {
return "com.woltlab.wcf.moderation";
}
+ hasUnreadContent(): boolean {
+ return this.counter > 0;
+ }
+
async markAsRead(objectId: number): Promise<void> {
const response = (await dboAction("markAsRead", "wcf\\data\\moderation\\queue\\ModerationQueueAction")
.objectIds([objectId])
return this.options.noItems;
}
+ hasUnreadContent(): boolean {
+ return this.counter > 0;
+ }
+
isStale(): boolean {
if (this.stale) {
return true;
getView(): UserMenuView;
+ hasUnreadContent(): boolean;
+
isStale(): boolean;
markAsRead(objectId: number): Promise<void>;
else {
this.openNotifications();
}
+ this.refreshTabUnreadIndicators();
this.refreshUnreadIndicator();
}
openNotifications() {
if (legacyPanel) {
legacyPanel.close();
}
+ this.refreshTabUnreadIndicators();
}
attachViewToPanel(tab) {
const origin = tab.dataset.origin;
const panelId = Util_1.default.getUniqueId();
const tab = document.createElement("a");
tab.classList.add("pageMenuUserTab");
+ tab.dataset.hasUnreadContent = "false";
tab.dataset.origin = data.origin;
tab.id = tabId;
tab.setAttribute("aria-controls", panelId);
this.userMenu.classList.remove("pageMenuMobileButtonHasContent");
}
}
+ refreshTabUnreadIndicators() {
+ this.userMenuProviders.forEach((provider, tab) => {
+ if (provider.hasUnreadContent()) {
+ tab.dataset.hasUnreadContent = "true";
+ }
+ else {
+ tab.dataset.hasUnreadContent = "false";
+ }
+ });
+ }
}
exports.PageMenuUser = PageMenuUser;
function hasValidUserMenu() {
getIdentifier() {
return "com.woltlab.wcf.moderation";
}
+ hasUnreadContent() {
+ return this.counter > 0;
+ }
async markAsRead(objectId) {
const response = (await (0, Ajax_1.dboAction)("markAsRead", "wcf\\data\\moderation\\queue\\ModerationQueueAction")
.objectIds([objectId])
getEmptyViewMessage() {
return this.options.noItems;
}
+ hasUnreadContent() {
+ return this.counter > 0;
+ }
isStale() {
if (this.stale) {
return true;
&[aria-selected="true"] {
background-color: var(--background-color-active);
}
+
+ &[aria-selected="false"][data-has-unread-content="true"]::after {
+ background-color: var(--color-indicator);
+ border-radius: 50%;
+ content: "";
+ height: 10px;
+ opacity: 1;
+ position: absolute;
+ right: 5px;
+ top: 5px;
+ width: 10px;
+ }
}
.pageMenuUserTabPanel {