summaryrefslogtreecommitdiffstats
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rw-r--r--script/custom.js19
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