HEX
Server: Apache
System: Linux webm010.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: iestorre (46869)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/i/e/s/iestorre/www2/modules/filetree/filetree.js
Drupal.behaviors.filetree = function(context) {

  // Collapse the sub-folders.
  $('.filetree .files ul').hide();

  // Expand/collapse sub-folder when clicking parent folder.
  $('.filetree .files li.folder').click(function(e) {
    // A link was clicked, so don't mess with the folders.
    if ($(e.target).is('a')) {
      return;
    }
    // Determine whether or not to use an animation when toggling folders.
    var animation = $(this).parents('.filetree').hasClass('filetree-animation') ? 'fast' : '';
    // If multiple folders are not allowed, collapse non-parent folders.
    if (!$(this).parents('.filetree').hasClass('multi')) {
      $(this).parents('.files').find('li.folder').not($(this).parents()).not($(this)).removeClass('expanded').find('ul:first').hide(animation);
    }
    // Expand.
    if (!$(this).hasClass('expanded')) {
      $(this).addClass('expanded').find('ul:first').show(animation);
    }
    // Collapse.
    else {
      $(this).removeClass('expanded').find('ul:first').hide(animation);
    }
    // Prevent collapsing parent folders.
    return false;
  });

  // Expand/collapse all when clicking controls.
  $('.filetree .controls a').click(function() {
    var animation = $(this).parents('.filetree').hasClass('filetree-animation') ? 'fast' : '';
    if ($(this).hasClass('expand')) {
      $(this).parents('.filetree').find('.files li.folder').addClass('expanded').find('ul:first').show(animation);
    }
    else {
      $(this).parents('.filetree').find('.files li.folder').removeClass('expanded').find('ul:first').hide(animation);
    }
    return false;
  });

};