Sha256: 2451fd2911c7b30006d0b3e3601296b20b50325b81f7be895c3eaec98694bad4

Contents?: true

Size: 1.1 KB

Versions: 9

Compression:

Stored size: 1.1 KB

Contents

/* expand_contract_toggle.js: Support for show more/hide more in lists of umlaut content.
  
  Expand/collapse elements are already controlled via Bootstrap toggle,
  this just adds some additional behavior in hooks to change our labels
  and disclosure icons appropriately, and prevent following non-js href links. 
*/
jQuery(document).ready(function($) {
  $(document).on("click", ".collapse-toggle", function(event) {
    event.preventDefault();    
    return false;
  });
  $(document).on("show", ".collapse", function(event) {
      // Update the icon
      $(this).parent().find('.collapse-toggle i').removeClass("umlaut_icons-list-closed").addClass("umlaut_icons-list-open");
      // Update the action label
      $(this).parent().find(".expand_contract_action_label").text("Hide ");

  });
  $(document).on("hide", ".collapse", function(event) {
      // Update the icon
      $(this).parent().find('.collapse-toggle i').removeClass("umlaut_icons-list-open").addClass("umlaut_icons-list-closed");
      // Update the action label
      $(this).parent().find(".expand_contract_action_label").text("Show ");

  });
});

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
umlaut-4.0.0.beta4 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-4.0.0.beta3 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-4.0.0.beta2 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-4.0.0.beta1 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-3.3.1 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-3.3.0 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-3.2.0 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-3.1.1 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-3.1.0 app/assets/javascripts/umlaut/expand_contract_toggle.js