diff options
author | Simon Rettberg | 2015-02-04 17:58:01 +0100 |
---|---|---|
committer | Simon Rettberg | 2015-02-04 17:58:01 +0100 |
commit | 43bc68c732338be2e82c5c516f20704e12d82a7c (patch) | |
tree | 3cd7b72884b70906e2898bcff643720d88d4cbac /script | |
parent | Config.tgz improvements, automatic rebuilds etc. (diff) | |
download | slx-admin-43bc68c732338be2e82c5c516f20704e12d82a7c.tar.gz slx-admin-43bc68c732338be2e82c5c516f20704e12d82a7c.tar.xz slx-admin-43bc68c732338be2e82c5c516f20704e12d82a7c.zip |
Finish config module editing
Diffstat (limited to 'script')
-rw-r--r-- | script/custom.js | 19 |
1 files changed, 12 insertions, 7 deletions
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 |