Skip to content

Instantly share code, notes, and snippets.

@greggb
Created July 23, 2013 20:29
Show Gist options
  • Select an option

  • Save greggb/6065873 to your computer and use it in GitHub Desktop.

Select an option

Save greggb/6065873 to your computer and use it in GitHub Desktop.
Noodling on a "see more" method
var el = Y.all(".show-more");
hideChildren: function() {
Y.each(el, function(item, index, array) {
var childEls = item.get('children'),
nodeLimit = item.getData("limit"),
hiddenChildEls;
if (childEls.length > nodeLimit) {
hiddenChildEls = childEls.slice(nodeLimit + 1);
hiddenChildEls.hide();
}
}
}
showChildren: function() {
var itemsToShow = e.target.ancester("el").get('children');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment