Sha256: dd58d8802081dccbdc26e67ae8d488f36dcd2b254d577e4f30eb882b620bef53

Contents?: true

Size: 1.14 KB

Versions: 12

Compression:

Stored size: 1.14 KB

Contents

/* expand_contract_toggle.js: Support for show more/hide more in lists of umlaut content.
   
   The JS needs to swap out the image for expand/contract toggle. AND we need
   the URL it swaps in to be an ABSOLUTE url when we're using partial html
   widget. 
   
   So we swap in a non-fingerprinted URL, even if the original was asset
   pipline fingerprinted. sorry, best way to make it work!
*/
jQuery(document).ready(function($) {
   
    $(".expand_contract_toggle").live("click", function() {
        var content = $(this).next(".expand_contract_content");
        var icon = $(this).parent().find('img.toggle_icon');
        
        if (content.is(":visible")) {  
          icon.attr("src", icon.attr("src").replace(/list_open[^.]*\.png/, "list_closed.png"));
          $(this).find(".expand_contract_action_label").text("Show ");
          
          content.hide();
          
        }
        else {
          icon.attr("src", icon.attr("src").replace(/list_closed[^.]*\.png/, "list_open.png"));
          $(this).find(".expand_contract_action_label").text("Hide ");
          content.show();
        }
        
        return false;
    });
    
    
});

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
umlaut-3.0.4 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-3.0.3 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-3.0.2 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-3.0.1 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-3.0.0 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-3.0.0rc1 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-3.0.0beta10 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-3.0.0beta9 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-3.0.0beta8 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-3.0.0beta7 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-3.0.0beta6 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-3.0.0beta5 app/assets/javascripts/umlaut/expand_contract_toggle.js