From bc0777274f722df79265cbddc2330b0dc0396cf5 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 13 Feb 2018 15:52:11 +0100 Subject: [PATCH] Fixed issue #1829 - The column widths of a table are shifted after manual change and use of pagination. --- .../_application_controller_table.coffee | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_application_controller_table.coffee b/app/assets/javascripts/app/controllers/_application_controller_table.coffee index 64433f28e..27395ec26 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_table.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_table.coffee @@ -195,8 +195,8 @@ class App.ControllerTable extends App.Controller el.filter('.js-pager').html('') return pager = App.view('generic/table_pager')( - page: @shownPage - pages: pages + page: @shownPage + pages: pages ) if find el.find('.js-pager').html(pager) @@ -851,13 +851,21 @@ class App.ControllerTable extends App.Controller # update store and runtime @headerWidth @preferencesStore('headerWidth', leftColumnKey, leftWidth) @headerWidth[leftColumnKey] = leftWidth - _.find(@headers, (column) -> column.name is leftColumnKey).displayWidth = leftWidth + + # set header at runtime + for header in @headers + if header.name is leftColumnKey + header.displayWidth = @resizeTargetLeft.outerWidth() # update store and runtime @headerWidth if rightColumnKey @preferencesStore('headerWidth', rightColumnKey, rightWidth) @headerWidth[rightColumnKey] = rightWidth - _.find(@headers, (column) -> column.name is rightColumnKey).displayWidth = rightWidth + + # set header at runtime + for header in @headers + if header.name is rightColumnKey + header.displayWidth = @resizeTargetRight.outerWidth() sortByColumn: (event) => column = $(event.currentTarget).closest('[data-column-key]').attr('data-column-key')