Sha256: 969231cb43e569d64ec5d8e4f72e95b594edfeaab88705c8c3a585af1e9aaf75

Contents?: true

Size: 638 Bytes

Versions: 4

Compression:

Stored size: 638 Bytes

Contents

$(document).ready ->
  $(".accordion-tabs").each (index) ->
    $(this).children("li").first().children("a").addClass("is-active").next().addClass("is-open").show()
    return

  $(".accordion-tabs").on "click", "li > a", (event) ->
    unless $(this).hasClass("is-active")
      event.preventDefault()
      accordionTabs = $(this).closest(".accordion-tabs")
      accordionTabs.find(".is-open").removeClass("is-open").hide()
      $(this).next().toggleClass("is-open").toggle()
      accordionTabs.find(".is-active").removeClass "is-active"
      $(this).addClass "is-active"
    else
      event.preventDefault()
    return

  return

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
breezeblocks-0.0.4 source/javascripts/breezeblocks/coffeescript/accordion_tabs.coffee
breezeblocks-0.0.2 source/javascripts/breezeblocks/coffeescript/accordion_tabs.coffee
breezeblocks-0.0.1 source/javascripts/breezeblocks/coffeescript/accordion_tabs.coffee
refills-0.1.0 source/javascripts/refills/coffeescript/accordion_tabs.coffee