author | Tero Marttila <terom@fixme.fi> |
Fri, 21 Jan 2011 04:40:36 +0200 | |
changeset 60 | b364279347d9 |
parent 1 | 06451697083a |
permissions | -rw-r--r-- |
/** * Dynamically expandable tree-form lists */ /* Document startup */ function treelist_init () { $$('.treelist li').each(function (item_li) { item_handle = item_li.down('div.item'); item_handle.on('click', function (event, element) { // only target clicks directly in div, not in element inside it if (!element.match('div.item')) return; if (item_li.hasClassName('more')) item_li.toggleClassName('open'); }); }); } Event.on(window, 'load', treelist_init);