Improved way to set notification popover height. Added immediately set counter to 0 on client side after "mark all as read" click.
This commit is contained in:
parent
1fd691b9d9
commit
5cb22714db
1 changed files with 10 additions and 3 deletions
|
@ -47,6 +47,7 @@ class App.OnlineNotificationWidget extends App.Controller
|
||||||
@toggle.append('<div class="activity-counter">' + count.toString() + '</div>')
|
@toggle.append('<div class="activity-counter">' + count.toString() + '</div>')
|
||||||
|
|
||||||
markAllAsRead: =>
|
markAllAsRead: =>
|
||||||
|
@counterUpdate(0)
|
||||||
@ajax(
|
@ajax(
|
||||||
id: 'markAllAsRead'
|
id: 'markAllAsRead'
|
||||||
type: 'POST'
|
type: 'POST'
|
||||||
|
@ -64,13 +65,19 @@ class App.OnlineNotificationWidget extends App.Controller
|
||||||
@updateContent()
|
@updateContent()
|
||||||
|
|
||||||
# set heigth of notification popover
|
# set heigth of notification popover
|
||||||
height = $('#app').height()
|
heightApp = $('#navigation').height()
|
||||||
$('.js-notificationsContainer').css('height', "#{height-12}px")
|
heightPopoverHeader = $('.js-notificationsContainer .popover-notificationsHeader').height()
|
||||||
|
heightPopoverContent = $('.js-notificationsContainer .popover-content').get(0).scrollHeight
|
||||||
|
height = heightPopoverHeader + heightPopoverContent
|
||||||
|
if height > heightApp
|
||||||
|
height = heightApp - heightPopoverHeader - 56
|
||||||
|
$('.js-notificationsContainer .popover-content').css('height', "#{height}px")
|
||||||
|
|
||||||
|
# set popover arrow
|
||||||
$('.js-notificationsContainer .arrow').css('top', '20px')
|
$('.js-notificationsContainer .arrow').css('top', '20px')
|
||||||
|
|
||||||
# close notification list on click
|
# close notification list on click
|
||||||
$('.js-notificationsContainer').on('click', (e) =>
|
$('.js-notificationsContainer').on('click', (e) =>
|
||||||
#console.log('CL')
|
|
||||||
@hidePopover()
|
@hidePopover()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue