(bug 16073) * Use onclick handler for expand/collapse in enhanced recentchanges.
[lhc/web/wiklou.git] / skins / common / enhancedchanges.js
1 /*
2 JavaScript file for enhanced recentchanges
3 */
4
5 /*
6 * onload hook to add the CSS to hide parts that should be collapsed
7 *
8 * We do this with JS so everything will be expanded by default
9 * if JS is disabled
10 */
11 addOnloadHook(function () {
12 var css = ".mw-rc-jshidden { display:none; }";
13 appendCSS(css);
14 });
15
16 /*
17 * Switch an RC line between hidden/shown
18 * @param int idNumber : the id number of the RC group
19 */
20 function toggleVisibility(idNumber) {
21 var openarrow = document.getElementById("mw-rc-openarrow-"+idNumber);
22 var closearrow = document.getElementById("mw-rc-closearrow-"+idNumber);
23 var subentries = document.getElementById("mw-rc-subentries-"+idNumber);
24 if (openarrow.style.display == 'inline') {
25 openarrow.style.display = 'none';
26 closearrow.style.display = 'inline';
27 subentries.style.display = 'block';
28 } else {
29 openarrow.style.display = 'inline';
30 closearrow.style.display = 'none';
31 subentries.style.display = 'none';
32 }
33 }