show_or_hide_on_click : function()

in js/drill.js [144:176]


  show_or_hide_on_click : function() {
    var l2nodes = $('li.toctree-l2').filter(function(){ 
      return $(this).next('ul').length > 0;
    });

    $('li[class^=toctree]')
    .filter(function(){
      return $(this).next('ul').length > 0;
    })
    .on("click", function(){
      var $toctree = $(this);
      var $this_ul = $toctree.next("ul");
      $.each( $this_ul, function(i){
        if ( $(this).is(':hidden') ) {

          if ( $.inArray( $toctree[0], l2nodes ) > -1 ) {
            $toctree.children("span.expand").removeClass('show');
            $toctree.children("span.contract").addClass('show');
          }

          $(this).slideDown();
        } else {

          if ( $.inArray( $toctree[0], l2nodes ) > -1 ) {
            $toctree.children("span.expand").addClass('show');
            $toctree.children("span.contract").removeClass('show');
          }

          $(this).slideUp();
        }
      })
    })
  },