Sha256: dfb4b5c98723401a216cff4be0e4ad05f407839911ce4841a88fff77883f4224
Contents?: true
Size: 977 Bytes
Versions: 8
Compression:
Stored size: 977 Bytes
Contents
Blacklight.onLoad(function(){ Blacklight.do_hierarchical_facet_expand_contract_behavior(); }); (function($) { Blacklight.do_hierarchical_facet_expand_contract_behavior = function() { $( Blacklight.do_hierarchical_facet_expand_contract_behavior.selector ).each ( Blacklight.hierarchical_facet_expand_contract ); } Blacklight.do_hierarchical_facet_expand_contract_behavior.selector = 'li.h-node'; Blacklight.hierarchical_facet_expand_contract = function() { var li = $(this); $('ul', this).each(function() { li.addClass('twiddle'); if($('span.selected', this).length == 0){ $(this).hide(); } else { li.addClass('twiddle-open'); } }); // attach the toggle behavior to the li tag li.click(function(e){ if (e.target == this) { // toggle the content $(this).toggleClass('twiddle-open'); $(this).children('ul').slideToggle(); } }); }; })(jQuery);
Version data entries
8 entries across 8 versions & 1 rubygems