MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
Pianoforte (talk | contribs) No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
original_onload = window.onload; | |||
sortables_init(); | |||
window.onload = function() { | |||
original_onload(); | |||
if (cell.innerHTML.indexOf("sortheader") < 0) { | |||
sortables_init(); | |||
// sort the first sortable table; change [0] to sort other tables. | |||
tab = document.getElementsByTagName("table")[0]; | |||
// sort by the first column; change [0] to sort by other columns. | |||
hdr = tab.getElementsByTagName("th")[0]; | |||
// get the sort button link | |||
lnk = hdr.getElementsByTagName("a")[0]; | |||
ts_resortTable(lnk); | |||
} | |||
} | } |
Revision as of 03:46, 27 October 2016
original_onload = window.onload;
window.onload = function() {
original_onload();
if (cell.innerHTML.indexOf("sortheader") < 0) {
sortables_init();
// sort the first sortable table; change [0] to sort other tables.
tab = document.getElementsByTagName("table")[0];
// sort by the first column; change [0] to sort by other columns.
hdr = tab.getElementsByTagName("th")[0];
// get the sort button link
lnk = hdr.getElementsByTagName("a")[0];
ts_resortTable(lnk);
}
}