Difference between revisions of "MediaWiki:Common.js"
Jump to navigation
Jump to search
Pianoforte (talk | contribs) |
Pianoforte (talk | contribs) |
||
Line 1: | Line 1: | ||
− | sortables_init(); | + | if (cell.innerHTML.indexOf("sortheader") < 0) { |
+ | sortables_init(); | ||
// sort the first sortable table; change [0] to sort other tables. | // sort the first sortable table; change [0] to sort other tables. | ||
tab = document.getElementsByTagName("table")[0]; | tab = document.getElementsByTagName("table")[0]; | ||
Line 7: | Line 8: | ||
lnk = hdr.getElementsByTagName("a")[0]; | lnk = hdr.getElementsByTagName("a")[0]; | ||
ts_resortTable(lnk); | ts_resortTable(lnk); | ||
+ | } |
Revision as of 03:30, 27 October 2016
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);
}