{/if}
<li class="menuOverlayItemSpacer"></li>
<li class="menuOverlayItem" data-more="com.woltlab.wcf.notifications">
- <a href="{link controller='NotificationList'}{/link}" class="menuOverlayItemLink box24">
+ <a href="{link controller='NotificationList'}{/link}" class="menuOverlayItemLink menuOverlayItemBadge box24" data-badge-identifier="userNotifications">
<span class="icon icon24 fa-bell-o"></span>
<span class="menuOverlayItemTitle">{lang}wcf.user.notification.notifications{/lang}</span>
+ {if $__wcf->getUserNotificationHandler()->getNotificationCount()}<span class="badge badgeUpdate">{#$__wcf->getUserNotificationHandler()->getNotificationCount()}</span>{/if}
</a>
</li>
{if $__wcf->user->userID && $__wcf->session->getPermission('mod.general.canUseModeration')}
<li class="menuOverlayItem" data-more="com.woltlab.wcf.moderation">
- <a href="#" class="menuOverlayItemLink box24">
+ <a href="#" class="menuOverlayItemLink menuOverlayItemBadge box24" data-badge-identifier="outstandingModeration">
<span class="icon icon24 fa-exclamation-triangle"></span>
<span class="menuOverlayItemTitle">{lang}wcf.moderation.moderation{/lang}</span>
+ {if $__wcf->getModerationQueueManager()->getOutstandingModerationCount()}<span class="badge badgeUpdate">{#$__wcf->getModerationQueueManager()->getOutstandingModerationCount()}</span>{/if}
</a>
</li>
{/if}
this._markAllAsReadLink = null;
}
}
+
+ WCF.System.Event.fireEvent('com.woltlab.wcf.userMenu', 'updateBadge', {
+ count: count,
+ identifier: this._identifier
+ });
},
/**
this._removeActiveList = false;
var callbackOpen = this.open.bind(this);
- var button = elBySel(buttonSelector);
- button.addEventListener(WCF_CLICK_EVENT, callbackOpen);
+ this._button = elBySel(buttonSelector);
+ this._button.addEventListener(WCF_CLICK_EVENT, callbackOpen);
this._initItems();
this._initHeader();
backdrop.addEventListener(WCF_CLICK_EVENT, this.close.bind(this));
DomUtil.insertAfter(backdrop, this._menu);
+
+ this._updateButtonState();
},
/**
this._depth += (increase) ? 1 : -1;
this._menu.children[0].style.setProperty('transform', 'translateX(' + (this._depth * -100) + '%)', '');
+ },
+
+ _updateButtonState: function() {
+ var hasNewContent = false;
+ elBySelAll('.badgeUpdate', this._menu, function (badge) {
+ if (~~badge.textContent > 0) {
+ hasNewContent = true;
+ }
+ });
+
+ this._button.classList[(hasNewContent ? 'add' : 'remove')]('pageMenuMobileButtonHasContent');
}
};
'pageUserMenuMobile',
'#pageHeader .userPanel'
);
+
+ EventHandler.add('com.woltlab.wcf.userMenu', 'updateBadge', (function (data) {
+ elBySelAll('.menuOverlayItemBadge', this._menu, (function (item) {
+ if (elData(item, 'badge-identifier') === data.identifier) {
+ var badge = elBySel('.badge', item);
+ if (data.count) {
+ if (badge === null) {
+ badge = elCreate('span');
+ badge.className = 'badge badgeUpdate';
+ item.appendChild(badge);
+ }
+
+ badge.textContent = data.count;
+ }
+ else if (badge !== null) {
+ elRemove(badge);
+ }
+
+ this._updateButtonState();
+ }
+ }).bind(this));
+ }).bind(this));
}
});
}
}
+@keyframes wcfMobileMenuNewContent {
+ 0% { box-shadow: 0 0 0 rgba(255, 0, 0, 0); }
+ 25% { box-shadow: 0 0 0 rgba(255, 0, 0, 1); }
+ 50% { box-shadow: 0 0 10px rgba(255, 0, 0, 1); }
+ 75% { box-shadow: 0 0 0 rgba(255, 0, 0, 1); }
+ 100% { box-shadow: 0 0 0 rgba(255, 0, 0, 0); }
+}
+
@include screen-md-down {
.pageHeader > div > div {
padding-bottom: 10px;
.userPanel {
&::before {
background-color: $wcfHeaderMenuBackground;
+ border-radius: 2px;
color: $wcfHeaderMenuLink;
font-family: FontAwesome;
font-size: 28px;
background-color: $wcfHeaderMenuLinkBackgroundActive;
color: $wcfHeaderMenuLinkActive;
}
+
+ &.pageMenuMobileButtonHasContent::before {
+ animation: wcfMobileMenuNewContent 8s infinite;
+ animation-delay: 2s;
+ }
}
.pageHeaderSearch:not(.open) {
}
}
+.pageUserMenuMobile .menuOverlayItemBadge:last-child {
+ padding-right: 10px !important;
+}
+
.menuOverlayItemLink.active,
.menuOverlayItemLinkIcon.active {
background-color: rgb(34, 49, 63);