From 43bc68c732338be2e82c5c516f20704e12d82a7c Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 4 Feb 2015 17:58:01 +0100 Subject: Finish config module editing --- script/custom.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'script') diff --git a/script/custom.js b/script/custom.js index 675bf581..b2c5b2a7 100644 --- a/script/custom.js +++ b/script/custom.js @@ -13,15 +13,20 @@ function loadContent(elem, source) function forceTable(t) { var pwidth = t.parent().innerWidth(); - t.width(pwidth - 5); var rows = t.find('tr'); + var row = rows.first(); + pwidth = Math.round(pwidth); + t.width(pwidth); var sum = 0; - rows.first().find('td').each(function (index) { + row.find('td').each(function() { if (!$(this).hasClass('slx-width-ignore')) - sum += $(this).outerWidth(); - }); - var w = pwidth - (sum + 30); - rows.find('.slx-dyn-ellipsis').each(function (index) { - $(this).width(w).css('width', w + 'px').css('max-width', w + 'px'); + sum += $(this).outerWidth(true); }); + var w = Math.round(pwidth - sum); + do { + rows.find('.slx-dyn-ellipsis').each(function() { + $(this).width(w).css('width', w + 'px').css('max-width', w + 'px'); + }); + w -= 3; + } while (t.width() > pwidth); } \ No newline at end of file -- cgit v1.2.3-55-g7522