diff --git a/app/assets/javascripts/app/controllers/_application_controller_table.coffee b/app/assets/javascripts/app/controllers/_application_controller_table.coffee index a9656dcaa..a297a0424 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_table.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_table.coffee @@ -45,7 +45,7 @@ class App.ControllerTable extends App.Controller helper = tr.clone() helper.children().each (index) -> # Set helper cell sizes to match the original sizes - $(this).width( originals.eq(index).outerWidth() ) + $(@).width( originals.eq(index).outerWidth() ) return helper update: @dndCallback @el.find('table > tbody').sortable(dndOptions) diff --git a/app/assets/javascripts/app/controllers/widget/online_notification.coffee b/app/assets/javascripts/app/controllers/widget/online_notification.coffee index 5fdb749f3..386a13c45 100644 --- a/app/assets/javascripts/app/controllers/widget/online_notification.coffee +++ b/app/assets/javascripts/app/controllers/widget/online_notification.coffee @@ -113,9 +113,7 @@ class App.OnlineNotificationWidget extends App.Controller processData: true ) - onShow: => - @updateContent() - + updateHeight: -> # set height of notification popover notificationsContainer = $('.js-notificationsContainer') heightApp = $('#app').height() @@ -131,6 +129,10 @@ class App.OnlineNotificationWidget extends App.Controller notificationsContainer.find('.popover-content').css('height', "#{heightPopoverContentNew}px") + onShow: => + @updateContent() + @updateHeight() + # mark all notifications as read notificationsContainer.find('.js-markAllAsRead').on('click', (e) => e.preventDefault() @@ -221,7 +223,7 @@ class App.OnlineNotificationWidget extends App.Controller row = $(e.target).closest('.activity-entry') id = row.data('id') App.OnlineNotification.destroy(id) - @resetHeight() + @updateHeight() ) createContainer: => @@ -254,7 +256,3 @@ class App.OnlineNotificationWidget extends App.Controller @counterUpdate(0) @toggle.popover('destroy') - resetHeight: -> - notificationsContainer = $('.js-notificationsContainer') - notificationsContainer.find('.popover-content').css('height', 'auto') - diff --git a/app/assets/javascripts/app/views/generic/table.jst.eco b/app/assets/javascripts/app/views/generic/table.jst.eco index 6bbf33c01..6b52e354d 100644 --- a/app/assets/javascripts/app/views/generic/table.jst.eco +++ b/app/assets/javascripts/app/views/generic/table.jst.eco @@ -2,10 +2,10 @@ <% if @sortable: %> - + <% end %> <% if @checkbox: %> - +