diff --git a/dictionaries/en.dictionary.itop.ui.php b/dictionaries/en.dictionary.itop.ui.php index 973304074..0a7533900 100644 --- a/dictionaries/en.dictionary.itop.ui.php +++ b/dictionaries/en.dictionary.itop.ui.php @@ -1595,6 +1595,7 @@ Dict::Add('EN US', 'English', 'English', array( // Dict::Add('EN US', 'English', 'English', array( 'UI:Newsroom:NoNewMessage' => 'No new message', + 'UI:Newsroom:XNewMessage' => '%1$s new message(s)', 'UI:Newsroom:MarkAllAsRead' => 'Mark all messages as read', 'UI:Newsroom:ViewAllMessages' => 'View all messages', 'UI:Newsroom:Preferences' => 'Newsroom preferences', diff --git a/js/components/newsroom-menu.js b/js/components/newsroom-menu.js index 2b82ad486..e716a4ed3 100644 --- a/js/components/newsroom-menu.js +++ b/js/components/newsroom-menu.js @@ -13,9 +13,10 @@ $(function() placeholder_image_icon: '', providers: [], labels: { - 'no_message': 'No new message', - 'mark_all_as_read': 'Mark all as read', - 'view_all': 'View all messages' + no_notification: 'UI:Newsroom:NoNewMessage', + x_notifications: 'UI:Newsroom:XNewMessage', + mark_all_as_read: 'UI:Newsroom:MarkAllAsRead', + view_all: 'UI:Newsroom:ViewAllMessages' } }, css_classes: @@ -26,6 +27,7 @@ $(function() js_selectors: { menu_toggler: '[data-role="ibo-navigation-menu--notifications-toggler"]', + menu_toggler_message: '[data-role="ibo-navigation-menu--user-notifications--toggler--message"]', }, // the constructor @@ -170,12 +172,22 @@ $(function() if (oDate1 < oDate2) return 1; return 1; }); - + this._refreshTogglerMessage(aAllMessages.length); this._buildMenu(aAllMessages); }, + _refreshTogglerMessage : function(iItemCount){ + var sMessage = this.options.labels.no_notification; + if(iItemCount > 0){ + sMessage = Dict.Format(this.options.labels.x_notifications, iItemCount); + } + $(this.js_selectors.menu_toggler_message).html(sMessage); + $(this.js_selectors.menu_toggler).attr('data-tooltip-content', sMessage); + CombodoTooltip.InitTooltipFromMarkup($(this.js_selectors.menu_toggler), true); + }, _buildDismissAllSection: function() { - return '
'; + return ''; }, _buildMessageSection: function () { return '