Sha256: 7ae11ddc4547f2976bc6ca080c6784b769d3abe82bc334c2ca30b99b95b4d2f1

Contents?: true

Size: 1.13 KB

Versions: 16

Compression:

Stored size: 1.13 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.bs.collapse", ".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.bs.collapse", ".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

16 entries across 16 versions & 1 rubygems

Version Path
umlaut-4.1.7 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-4.1.6 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-4.1.5 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-4.1.4 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-4.1.3 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-4.1.2 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-4.1.1 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-4.1.0 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-4.1.0.pre3 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-4.1.0.pre.2 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-4.1.0.pre.alpha.1 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-4.0.3 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-4.0.2 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-4.0.1 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-4.0.0 app/assets/javascripts/umlaut/expand_contract_toggle.js
umlaut-4.0.0.beta5 app/assets/javascripts/umlaut/expand_contract_toggle.js