summaryrefslogtreecommitdiffstats
path: root/script/custom.js
blob: 675bf58123424e636de3d1a5fdac3d2d08f72c95 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function loadContent(elem, source)
{
	var waitForIt = function() {
		if (typeof $ === 'undefined') {
			setTimeout(waitForIt, 50);
			return;
		}
		$(elem).load(source);
	}
	waitForIt();
}

function forceTable(t)
{
	var pwidth = t.parent().innerWidth();
	t.width(pwidth - 5);
	var rows = t.find('tr');
	var sum = 0;
	rows.first().find('td').each(function (index) {
		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');
	});
}