script.js 911 B

1234567891011121314151617181920
  1. $(function () {
  2. $('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch');
  3. $('.tree li.parent_li > span').on('click', function (e) {
  4. var children = $(this).parent('li.parent_li').find(' > ul > li');
  5. if (children.is(":visible")) {
  6. children.hide('fast');
  7. $(this).attr('title', 'Expand this branch').find(' > i').addClass('fa-plus-square').removeClass('fa-minus-square');
  8. } else {
  9. children.show('fast');
  10. $(this).attr('title', 'Collapse this branch').find(' > i').addClass('fa-minus-square').removeClass('fa-plus-square');
  11. }
  12. e.stopPropagation();
  13. });
  14. $('.tree .shape').on('click', function (e) {
  15. $('.infoBlk').hide();
  16. $('.infoBlk#' + $(this).attr('id') + 'Info').show();
  17. e.stopPropagation();
  18. });
  19. });