Small code layout improvement.
This commit is contained in:
parent
d29fde31e5
commit
57959900bc
1 changed files with 6 additions and 6 deletions
|
@ -355,7 +355,7 @@ class App.ControllerTable extends App.Controller
|
||||||
|
|
||||||
if unit is '%'
|
if unit is '%'
|
||||||
percentage = parseInt col.width, 10
|
percentage = parseInt col.width, 10
|
||||||
col.width = percentage / 100 * @el.width() + "px"
|
col.width = percentage / 100 * @el.width() + 'px'
|
||||||
|
|
||||||
return col
|
return col
|
||||||
|
|
||||||
|
@ -366,14 +366,14 @@ class App.ControllerTable extends App.Controller
|
||||||
headers = _.map headers, (col) =>
|
headers = _.map headers, (col) =>
|
||||||
if !col.unresizable
|
if !col.unresizable
|
||||||
value = parseInt col.width, 10
|
value = parseInt col.width, 10
|
||||||
col.width = Math.max(@minColWidth, value - shrinkBy) + "px"
|
col.width = Math.max(@minColWidth, value - shrinkBy) + 'px'
|
||||||
return col
|
return col
|
||||||
|
|
||||||
# give left-over space from rounding to last column to get to 100%
|
# give left-over space from rounding to last column to get to 100%
|
||||||
roundingLeftOver = @el.width() - @getHeaderWidths headers
|
roundingLeftOver = @el.width() - @getHeaderWidths headers
|
||||||
# but only if there is something left over (will get negative when there are too many columns for each column to stay in their min width)
|
# but only if there is something left over (will get negative when there are too many columns for each column to stay in their min width)
|
||||||
if roundingLeftOver > 0
|
if roundingLeftOver > 0
|
||||||
headers[headers.length - 1].width = parseInt(headers[headers.length - 1].width, 10) + roundingLeftOver + "px"
|
headers[headers.length - 1].width = parseInt(headers[headers.length - 1].width, 10) + roundingLeftOver + 'px'
|
||||||
|
|
||||||
return headers
|
return headers
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue