Skip to content

Instantly share code, notes, and snippets.

@tkh44
Created April 19, 2012 22:59
Show Gist options
  • Save tkh44/2424753 to your computer and use it in GitHub Desktop.
Save tkh44/2424753 to your computer and use it in GitHub Desktop.
YUI delegate
EVENT.delegate(elements.list, 'click', doExpandCollapse, 'li.category .categoryHeader .actionIcon'); //expand/collapse category event
function doExpandCollapse(event, matchedEl, container) {
var parentCategory = matchedEl.parentNode.parentNode;
if (DOM.hasClass(parentCategory, 'open')) {
collapseCategory(parentCategory, true);
} else {
expandCategory(parentCategory, true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment