From ba4e3231a4ecbaf6a3cc85eb7e8cd2c0abda2f50 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 19 Nov 2018 08:59:07 +0100 Subject: [PATCH] Fixed issue #2031 - Column width is resized to a non readable minimum. --- .../_application_controller_table.coffee | 5 ++--- .../app/controllers/ticket_overview.coffee | 13 ++++++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_application_controller_table.coffee b/app/assets/javascripts/app/controllers/_application_controller_table.coffee index c3af532d5..6db5b370b 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_table.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_table.coffee @@ -168,6 +168,8 @@ class App.ControllerTable extends App.Controller @headerWidth[key] = value @availableWidth = @el.width() + if @availableWidth is 0 + @availableWidth = @minTableWidth @renderQueue() @@ -820,9 +822,6 @@ class App.ControllerTable extends App.Controller calculateHeaderWidths: -> return if !@headers - if @availableWidth is 0 - @availableWidth = @minTableWidth - availableWidth = @availableWidth widths = @getHeaderWidths() diff --git a/app/assets/javascripts/app/controllers/ticket_overview.coffee b/app/assets/javascripts/app/controllers/ticket_overview.coffee index 620362ed4..3c186591c 100644 --- a/app/assets/javascripts/app/controllers/ticket_overview.coffee +++ b/app/assets/javascripts/app/controllers/ticket_overview.coffee @@ -1139,7 +1139,7 @@ class Table extends App.Controller attribute.title = object.iconTitle() value - @table = new App.ControllerTable( + tableArguments = tableId: "ticket_overview_#{@overview.id}" overview: @overview.view.s el: @$('.table-overview') @@ -1150,7 +1150,7 @@ class Table extends App.Controller groupDirection: @overview.group_direction orderBy: @overview.order.by orderDirection: @overview.order.direction - class: 'table--light' + class: 'table--light' bindRow: events: 'click': openTicket @@ -1176,7 +1176,14 @@ class Table extends App.Controller events: 'click': callbackCheckbox select_all: callbackCheckbox - ) + + # remember elWidth even if table is not shown but rerendered + if @el.width() != 0 + @elWidth = @el.width() + if @elWidth + tableArguments.minTableWidth = @elWidth + + @table = new App.ControllerTable(tableArguments) @renderPopovers()