Merge remote-tracking branch 'origin/master'

This commit is contained in:
Pootle server 2011-08-18 16:40:14 +02:00
commit 8be0226caf
3 changed files with 47 additions and 30 deletions

View File

@ -826,9 +826,11 @@
// if user has supplied a sort list to constructor.
if (config.sortList.length > 0) {
$this.trigger("sorton", [config.sortList]);
} else {
// appendToTable used in sorton event already calls applyWidget
// apply widgets
applyWidget(this);
}
// apply widgets
applyWidget(this);
});
};
this.addParser = function (parser) {

View File

@ -43,7 +43,24 @@ $(function() {
},
type: "numeric"
});
// faster zebra widget: no row visibility check, faster css class switching, no cssChildRow check
jQuery.tablesorter.addWidget({
id: "fast-zebra",
format: function (table) {
if (table.config.debug) {
var time = new Date();
}
$("tr:even", table.tBodies[0])
.removeClass(table.config.widgetZebra.css[0])
.addClass(table.config.widgetZebra.css[1]);
$("tr:odd", table.tBodies[0])
.removeClass(table.config.widgetZebra.css[1])
.addClass(table.config.widgetZebra.css[0]);
if (table.config.debug) {
$.tablesorter.benchmark("Applying Fast-Zebra widget", time);
}
}
});
// Popup behaviour
$('a[rel="popupLink"]').click( function() {
@ -456,6 +473,7 @@ $(function() {
}
}
});
initTableSorter(tab.attr('id'));
break;
case 'statustabs_allvars':
@ -463,43 +481,40 @@ $(function() {
tab.find('.tabInnerContent').html(data);
filterVariables();
}
initTableSorter(tab.attr('id'));
break;
}
initTableSorter(tab.attr('id'));
}
// TODO: tablesorter shouldn't sort already sorted columns
function initTableSorter(tabid) {
var $table, opts;
switch(tabid) {
case 'statustabs_queries':
$('#serverstatusqueriesdetails').tablesorter({
sortList: [[3, 1]],
widgets: ['zebra'],
headers: {
1: { sorter: 'fancyNumber' },
2: { sorter: 'fancyNumber' }
}
});
$('#serverstatusqueriesdetails tr:first th')
.append('<img class="icon sortableIcon" src="themes/dot.gif" alt="">');
$table = $('#serverstatusqueriesdetails');
opts = {
sortList: [[3, 1]],
widgets: ['fast-zebra'],
headers: {
1: { sorter: 'fancyNumber' },
2: { sorter: 'fancyNumber' }
}
};
break;
case 'statustabs_allvars':
$('#serverstatusvariables').tablesorter({
sortList: [[0, 0]],
widgets: ['zebra'],
headers: {
1: { sorter: 'fancyNumber' }
}
});
$('#serverstatusvariables tr:first th')
.append('<img class="icon sortableIcon" src="themes/dot.gif" alt="">');
$table = $('#serverstatusvariables');
opts = {
sortList: [[0, 0]],
widgets: ['fast-zebra'],
headers: {
1: { sorter: 'fancyNumber' }
}
};
break;
}
$table.tablesorter(opts);
$table.find('tr:first th')
.append('<img class="icon sortableIcon" src="themes/dot.gif" alt="">');
}
/* Filters the status variables by name/category/alert in the variables tab */

View File

@ -1680,7 +1680,7 @@ $(function() {
$('div#logTable table').tablesorter({
sortList: [[cols.length - 1, 1]],
widgets: ['zebra']
widgets: ['fast-zebra']
});
$('div#logTable table thead th')