Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MBS-11861: improve loopParity classes for tablesorter #2205

Merged
merged 1 commit into from Aug 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions root/static/scripts/statistics.js
Expand Up @@ -32,12 +32,14 @@ tablesorter.addWidget({
$('tbody tr', table).each(function (index) {
if ((index + 1) % 2 === 0) {
$(this).addClass('even');
$(this).removeClass('odd');
} else {
$(this).addClass('odd');
$(this).removeClass('even');
}
});
},
id: 'evenRowClasses',
id: 'loopParity',
});

tablesorter.addParser({
Expand All @@ -61,7 +63,7 @@ $('#countries-table').tablesorter({
},
// order by descending number of entities, then name
sortList: [[5, 1], [1, 0]],
widgets: ['indexFirstColumn', 'evenRowClasses'],
widgets: ['indexFirstColumn', 'loopParity'],
});

$('#languages-table').tablesorter({
Expand All @@ -73,12 +75,12 @@ $('#languages-table').tablesorter({
},
// order by descending number of entities, then name
sortList: [[4, 1], [1, 0]],
widgets: ['indexFirstColumn', 'evenRowClasses'],
widgets: ['indexFirstColumn', 'loopParity'],
});

$('#scripts-table').tablesorter({
headers: {[0]: {sorter: false}, [2]: {sorter: 'fancyNumber'}},
// order by descending number of entities, then name
sortList: [[2, 1], [1, 0]],
widgets: ['indexFirstColumn', 'evenRowClasses'],
widgets: ['indexFirstColumn', 'loopParity'],
});