tree.js 721 B

12345678910111213141516
  1. $(function(){
  2. $('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch');
  3. /*
  4. $('.tree li.parent_li > span').on('click', function (e) {
  5. var children = $(this).parent('li.parent_li').find(' > ul > li');
  6. if (children.is(":visible")) {
  7. children.hide('fast');
  8. $(this).attr('title', 'Expand this branch').find(' > i').addClass('glyphicon-plus-sign').removeClass('glyphicon-minus-sign');
  9. } else {
  10. children.show('fast');
  11. $(this).attr('title', 'Collapse this branch').find(' > i').addClass('glyphicon-minus-sign').removeClass('glyphicon-plus-sign');
  12. }
  13. e.stopPropagation();
  14. });
  15. */
  16. });