Only show "mark all as read" if min. one notification is available.
This commit is contained in:
parent
52d1edea9f
commit
59a4050838
1 changed files with 8 additions and 2 deletions
|
@ -40,7 +40,7 @@ class App.OnlineNotificationWidget extends App.Controller
|
||||||
if !count
|
if !count
|
||||||
@el.find('.js-counter').text('')
|
@el.find('.js-counter').text('')
|
||||||
return
|
return
|
||||||
|
|
||||||
@el.find('.js-counter').text(count)
|
@el.find('.js-counter').text(count)
|
||||||
|
|
||||||
markAllAsRead: =>
|
markAllAsRead: =>
|
||||||
|
@ -73,7 +73,7 @@ class App.OnlineNotificationWidget extends App.Controller
|
||||||
notificationsContainer.addClass('is-overflowing')
|
notificationsContainer.addClass('is-overflowing')
|
||||||
else
|
else
|
||||||
notificationsContainer.removeClass('is-overflowing')
|
notificationsContainer.removeClass('is-overflowing')
|
||||||
|
|
||||||
notificationsContainer.find('.popover-content').css('height', "#{heightPopoverContentNew}px")
|
notificationsContainer.find('.popover-content').css('height', "#{heightPopoverContentNew}px")
|
||||||
|
|
||||||
# close notification list on click
|
# close notification list on click
|
||||||
|
@ -118,6 +118,12 @@ class App.OnlineNotificationWidget extends App.Controller
|
||||||
App.i18n.translateInline( 'Notifications' ) + " <span class='popover-notificationsCounter'>#{counter}</span>"
|
App.i18n.translateInline( 'Notifications' ) + " <span class='popover-notificationsCounter'>#{counter}</span>"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# show mark all as read if needed
|
||||||
|
if counter is 0
|
||||||
|
$('.js-notificationsContainer .js-markAllAsRead').addClass('hidden')
|
||||||
|
else
|
||||||
|
$('.js-notificationsContainer .js-markAllAsRead').removeClass('hidden')
|
||||||
|
|
||||||
# update content
|
# update content
|
||||||
items = @prepareForObjectList(items)
|
items = @prepareForObjectList(items)
|
||||||
$('.js-notificationsContainer .popover-content').html(
|
$('.js-notificationsContainer .popover-content').html(
|
||||||
|
|
Loading…
Reference in a new issue