diff --git a/app/assets/javascripts/app/controllers/_application_controller_table.coffee b/app/assets/javascripts/app/controllers/_application_controller_table.coffee index b7b78d994..9d0d04feb 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_table.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_table.coffee @@ -281,7 +281,8 @@ class App.ControllerTable extends App.Controller @objects = @objects.concat groupObjects[group] groupObjects[group] = [] # release old array - @calculateHeaderWidths() + if @table_id + @calculateHeaderWidths() # get content table = App.view('generic/table')( @@ -406,8 +407,7 @@ class App.ControllerTable extends App.Controller container: @container calculateHeaderWidths: -> - if !@headers - return + return if !@headers if @availableWidth is 0 @availableWidth = @minTableWidth @@ -448,7 +448,7 @@ class App.ControllerTable extends App.Controller if @dndCallback widths += @sortableColWidth - return widths + widths setHeaderWidths: => @calculateHeaderWidths() diff --git a/app/assets/javascripts/app/views/generic/table.jst.eco b/app/assets/javascripts/app/views/generic/table.jst.eco index 9c24b3058..68bd27239 100644 --- a/app/assets/javascripts/app/views/generic/table.jst.eco +++ b/app/assets/javascripts/app/views/generic/table.jst.eco @@ -44,7 +44,7 @@ <% groupLast = '' %> <% for object in @objects: %> <% if @groupBy: %> - <% groupByName = @P( object, @groupBy, @attributes ) %> + <% groupByName = @P(object, @groupBy, @attributes) %> <% if groupLast isnt groupByName: %> <%= groupByName %> <% groupLast = groupByName %> @@ -74,7 +74,7 @@ <% end %> <% for item in @header: %> - <% value = @P( object, item.name, @attributes ) %> + <% value = @P(object, item.name, @attributes) %> <% if @callbacks: %> <% if item.name.substr(item.name.length-3, item.name.length) is '_id' && object[ item.name.substr(0, item.name.length-3) ]: %> <% refObject = object[ item.name.substr(0, item.name.length-3) ] %> @@ -82,7 +82,7 @@ <% for attribute, callbacksAll of @callbacks: %> <% if attribute is item.name: %> <% for callback in callbacksAll: %> - <% value = callback( value, object, item, @header, refObject ) %> + <% value = callback(value, object, item, @header, refObject) %> <% end %> <% end %> <% end %>