MediaWiki:Gadget-autosort.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 7:
(function ($, mw, rs) {
var $sortables = $('.sortable[class*="autosort="]');
console.log('Found sortables:', $sortables);
if (!$sortables.length) return;
rs.autosort = function () {
Line 14 ⟶ 15:
matched = (' ' + $(this).attr('class') + ' ').match(/autosort=(\d+)[,-]{1}(a|d)/),
$sortCol = $this.find('> thead th:nth-child(' + matched[1] + ')');
console.log('Matched details:', matched);
if (matched[2] === 'd') {
// descending

Navigation menu