Skip to content

Commit fece1cc

Browse files
committed
Extract function from registerOnload in server/plugins.js
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent 53172b0 commit fece1cc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

js/src/server/plugins.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/**
2-
* Functions used in server plugins pages
2+
* Make columns sortable, but only for tables with more than 1 data row.
33
*/
4-
AJAX.registerOnload('server/plugins.js', function () {
5-
// Make columns sortable, but only for tables with more than 1 data row
4+
function makeColumnsSortable () {
65
var $tables = $('#plugins_plugins table:has(tbody tr + tr)');
76
$tables.tablesorter({
87
sortList: [[0, 0]],
@@ -12,4 +11,8 @@ AJAX.registerOnload('server/plugins.js', function () {
1211
});
1312
$tables.find('thead th')
1413
.append('<div class="sorticon"></div>');
14+
}
15+
16+
AJAX.registerOnload('server/plugins.js', function () {
17+
makeColumnsSortable();
1518
});

0 commit comments

Comments
 (0)