File: toc.js

package info (click to toggle)
php-horde-wicked 2.0.1-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,528 kB
  • ctags: 1,236
  • sloc: php: 5,386; xml: 1,027; makefile: 10; sh: 3
file content (16 lines) | stat: -rw-r--r-- 441 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/**
 * Javascript code for making the TOC collapsible.
 *
 * See the enclosed file COPYING for license information (GPL). If you
 * did not receive this file, see http://www.horde.org/licenses/gpl.
 */

document.observe('dom:loaded', function() {
    var h2 = $('toc').down('h2'),
        ol = $('toc').down('ol');
    if (!ol) {
        return;
    }
    h2.setStyle({ cursor: 'pointer' });
    h2.observe('click', ol.toggle.bind(ol));
});