Most of the changes were done by PhpStorm. Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
23 lines
543 B
TypeScript
23 lines
543 B
TypeScript
import $ from 'jquery';
|
|
import { AJAX } from '../modules/ajax.ts';
|
|
|
|
/**
|
|
* Make columns sortable, but only for tables with more than 1 data row.
|
|
*/
|
|
function makeColumnsSortable () {
|
|
const $tables = $('#plugins_plugins table:has(tbody tr + tr)');
|
|
$tables.tablesorter({
|
|
sortList: [[0, 0]],
|
|
headers: {
|
|
1: { sorter: false }
|
|
}
|
|
});
|
|
|
|
$tables.find('thead th')
|
|
.append('<div class="sorticon"></div>');
|
|
}
|
|
|
|
AJAX.registerOnload('server/plugins.js', function () {
|
|
makeColumnsSortable();
|
|
});
|