Sha256: 9c3cc7f3a82efed235c3ce7be51dcfe9ce81683fb7b1def5ce9baba36d4a4b43

Contents?: true

Size: 1008 Bytes

Versions: 13

Compression:

Stored size: 1008 Bytes

Contents

$(".js-vertical-tab-content").hide();
$(".js-vertical-tab-content:first").show();

/* if in tab mode */
$(".js-vertical-tab").click(function(event) {
  event.preventDefault();

  $(".js-vertical-tab-content").hide();
  var activeTab = $(this).attr("rel");
  $("#"+activeTab).show();

  $(".js-vertical-tab").removeClass("is-active");
  $(this).addClass("is-active");

  $(".js-vertical-tab-accordion-heading").removeClass("is-active");
  $(".js-vertical-tab-accordion-heading[rel^='"+activeTab+"']").addClass("is-active");
});

/* if in accordion mode */
$(".js-vertical-tab-accordion-heading").click(function(event) {
  event.preventDefault();

  $(".js-vertical-tab-content").hide();
  var accordion_activeTab = $(this).attr("rel");
  $("#"+accordion_activeTab).show();

  $(".js-vertical-tab-accordion-heading").removeClass("is-active");
  $(this).addClass("is-active");

  $(".js-vertical-tab").removeClass("is-active");
  $(".js-vertical-tab[rel^='"+accordion_activeTab+"']").addClass("is-active");
});

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
refills-0.2.0 source/javascripts/refills/vertical_tabs.js
breezeblocks-0.0.4 source/javascripts/breezeblocks/vertical_tabs.js
breezeblocks-0.0.2 source/javascripts/breezeblocks/vertical_tabs.js
breezeblocks-0.0.1 source/javascripts/breezeblocks/vertical_tabs.js
refills-0.1.0 source/javascripts/refills/vertical_tabs.js
staple-0.0.9 source/javascripts/staple/vertical_tabs.js
staple-0.0.8 source/javascripts/staple/vertical_tabs.js
staple-0.0.7 source/javascripts/staple/vertical_tabs.js
staple-0.0.6 source/javascripts/staple/vertical_tabs.js
staple-0.0.5 source/javascripts/staple/vertical_tabs.js
staple-0.0.4 source/javascripts/staple/vertical_tabs.js
staple-0.0.3 source/javascripts/staple/vertical_tabs.js
staple-0.0.2 source/javascripts/staple/vertical_tabs.js