diff --git a/notifications/js/notificationajaxpopup.js b/notifications/js/notificationajaxpopup.js index eaa2f206f7..a61ef30b77 100644 --- a/notifications/js/notificationajaxpopup.js +++ b/notifications/js/notificationajaxpopup.js @@ -802,13 +802,12 @@ if (counter > 0) { $topmenu_info_notifications.addClass('egwpopup_notify'); - if (jQuery('#egw_fw_topmenu:visible').length == 0) $topmenu_info_notifications.append($popup_note); - $popup_note.text(egw.lang('You have %1 unread notifications', counter)); + framework.topmenu_info_notify('notifications', true, counter,egw.lang('You have %1 unread notifications', counter)); setTimeout(function (){$popup_note.remove();}, 4000); } else { - $topmenu_info_notifications.removeClass('egwpopup_notify'); + framework.topmenu_info_notify('notifications', false); } }; diff --git a/pixelegg/css/mobile.css b/pixelegg/css/mobile.css index 85d80d6d43..37c998e23a 100644 --- a/pixelegg/css/mobile.css +++ b/pixelegg/css/mobile.css @@ -5078,6 +5078,21 @@ td.message span.message { background-image: url(../images/notification_message.svg); border-left: 1px solid #636262; } +#egw_fw_topmenu_info_items #topmenu_info_notifications .egw_fw_topmenu_info_notify { + position: absolute; + background-color: #c14343; + bottom: 0px; + height: 17px; + white-space: nowrap; + line-height: 16px; + width: 17px; + border-top-right-radius: 50%; + margin-left: -3px; + color: #fff9fb; + border: 2px solid #ffffff; + text-align: center; + border-radius: 50%; +} #egw_fw_topmenu_info_items #topmenu_info_notifications .popup_note { position: absolute; width: 280px; diff --git a/pixelegg/css/monochrome.css b/pixelegg/css/monochrome.css index 05f7756e80..a45c3dbccd 100644 --- a/pixelegg/css/monochrome.css +++ b/pixelegg/css/monochrome.css @@ -5067,6 +5067,21 @@ td.message span.message { background-image: url(../images/notification_message.svg); border-left: 1px solid #636262; } +#egw_fw_topmenu_info_items #topmenu_info_notifications .egw_fw_topmenu_info_notify { + position: absolute; + background-color: #c14343; + bottom: 0px; + height: 17px; + white-space: nowrap; + line-height: 16px; + width: 17px; + border-top-right-radius: 50%; + margin-left: -3px; + color: #fff9fb; + border: 2px solid #ffffff; + text-align: center; + border-radius: 50%; +} #egw_fw_topmenu_info_items #topmenu_info_notifications .popup_note { position: absolute; width: 280px; diff --git a/pixelegg/css/pixelegg.css b/pixelegg/css/pixelegg.css index f0cad82e44..d11d7ed8f9 100644 --- a/pixelegg/css/pixelegg.css +++ b/pixelegg/css/pixelegg.css @@ -5078,6 +5078,21 @@ td.message span.message { background-image: url(../images/notification_message.svg); border-left: 1px solid #636262; } +#egw_fw_topmenu_info_items #topmenu_info_notifications .egw_fw_topmenu_info_notify { + position: absolute; + background-color: #c14343; + bottom: 0px; + height: 17px; + white-space: nowrap; + line-height: 16px; + width: 17px; + border-top-right-radius: 50%; + margin-left: -3px; + color: #fff9fb; + border: 2px solid #ffffff; + text-align: center; + border-radius: 50%; +} #egw_fw_topmenu_info_items #topmenu_info_notifications .popup_note { position: absolute; width: 280px; diff --git a/pixelegg/js/fw_pixelegg.js b/pixelegg/js/fw_pixelegg.js index 3bfea36158..908b3be7d0 100644 --- a/pixelegg/js/fw_pixelegg.js +++ b/pixelegg/js/fw_pixelegg.js @@ -71,6 +71,40 @@ et2_loadingFinished: function() { this._super.apply(this, arguments); setTimeout(function(){jQuery('#egw_fw_firstload').remove();}, 1000); + }, + + /** + * Set a notification message for topmenu info item + * + * @param {string} _id id of topmenu info item with its prefix + * @param {string} _message message that should be displayed + * @param {string} _tooltip hint text as tooltip + */ + topmenu_info_notify: function(_id, _switch, _message, _tooltip) { + var $items = jQuery('#egw_fw_topmenu_info_items').children(); + var prefix = "topmenu_info_"; + + $items.each(function(i,item){ + if (item.id == prefix+_id || item.id == _id) + { + var $notify = jQuery(item).find('.egw_fw_topmenu_info_notify'); + if (_switch) + { + if ($notify.length == 0) + { + $notify = jQuery(document.createElement('div')) + .addClass('egw_fw_topmenu_info_notify') + .prop('title', _tooltip) + .appendTo(item); + } + $notify.text(_message); + } + else + { + $notify.remove(); + } + } + }); } }); diff --git a/pixelegg/less/layout_raster_buttons.less b/pixelegg/less/layout_raster_buttons.less index c1e6fe2ed1..6e212d0ff9 100644 --- a/pixelegg/less/layout_raster_buttons.less +++ b/pixelegg/less/layout_raster_buttons.less @@ -119,6 +119,21 @@ opacity: 0.4; background-image: url(../images/notification_message.svg); border-left: 1px solid #636262; + .egw_fw_topmenu_info_notify { + position: absolute; + background-color: #c14343; + bottom: 0px; + height: 17px; + white-space: nowrap; + line-height: 16px; + width: 17px; + border-top-right-radius: 50%; + margin-left: -3px; + color: #fff9fb; + border: 2px solid #ffffff; + text-align: center; + border-radius: 50%; + } .popup_note { position: absolute; width: 280px; diff --git a/pixelegg/mobile/fw_mobile.css b/pixelegg/mobile/fw_mobile.css index 8932c24e1d..3ec02dbe97 100644 --- a/pixelegg/mobile/fw_mobile.css +++ b/pixelegg/mobile/fw_mobile.css @@ -5089,6 +5089,21 @@ td.message span.message { background-image: url(../images/notification_message.svg); border-left: 1px solid #636262; } +#egw_fw_topmenu_info_items #topmenu_info_notifications .egw_fw_topmenu_info_notify { + position: absolute; + background-color: #c14343; + bottom: 0px; + height: 17px; + white-space: nowrap; + line-height: 16px; + width: 17px; + border-top-right-radius: 50%; + margin-left: -3px; + color: #fff9fb; + border: 2px solid #ffffff; + text-align: center; + border-radius: 50%; +} #egw_fw_topmenu_info_items #topmenu_info_notifications .popup_note { position: absolute; width: 280px;