Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Not sure if there is an "API" way to do it. But if you look at the source code (Line 64-81)</p> <pre><code>if( $(this).parent().hasClass('directory') ) { if( $(this).parent().hasClass('collapsed') ) { // Expand if( !o.multiFolder ) { $(this).parent().parent().find('UL').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing }); $(this).parent().parent().find('LI.directory').removeClass('expanded').addClass('collapsed'); } $(this).parent().find('UL').remove(); // cleanup showTree( $(this).parent(), escape($(this).attr('rel').match( /.*\// )) ); $(this).parent().removeClass('collapsed').addClass('expanded'); } else { // Collapse $(this).parent().find('UL').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing }); $(this).parent().removeClass('expanded').addClass('collapsed'); } } else { h($(this).attr('rel')); } </code></pre> <p>Looks like you can call another function inside the <code>hasClass('directory')</code> if clause and it will work.</p> <p><strong>So you could:</strong></p> <p>Change Line 36 to be</p> <pre><code>fileTree: function(o, h, dire) { </code></pre> <p>Between 65 and 66 add</p> <pre><code>dire($(this).attr('rel')); </code></pre> <p>If you want to have more control/flexibility/information, you can do <code>dire($(this));</code> , and it will send the jQuery object instead of just the <code>rel</code> attribute. </p> <p><strong>Example:</strong></p> <pre><code>$(document).ready( function() { $('#container_id').fileTree({ root: '/some/folder/' }, function(file) { // do something when a file is clicked }, function(dir){ // do something when a dir is clicked }); }); </code></pre> <p>I have not tested it, you might need to change a couple of things around.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload