Sha256: 8f557007b51294962702f23f65922baf340972d48d44fe414163e5859e982869

Contents?: true

Size: 975 Bytes

Versions: 19

Compression:

Stored size: 975 Bytes

Contents

$.poised = {}
$.poised.tabs = (element, options) ->
  plugin = this
  plugin.settings = {}
  $element = $(element)
  element = element

  plugin.init = ->
    $header = $element.find('header ')
    $headerTabs = $header.find('.tab')

    updateActiveTab = (active) ->
      active ||= $element.find('.tab-content.active').attr('data-tab') || $element.find('.tab-content').first().attr('data-tab')
      $element.find('.tab, .tab-content').each (elem) ->
        $el = $(this)
        id = $el.attr('data-tab-view') || $el.attr('data-tab')
        $el.toggleClass('active', id == active)
      $activeTab = $header.find("[data-tab-view=#{active}]")

    $headerTabs.on 'tap', (e) ->
      updateActiveTab($(e.target).attr('data-tab-view'))
    updateActiveTab()

  plugin.init()

$.fn.poisedTabs = (options = {}) ->
  this.each ->
    $this = $(this)
    unless $this.data('poised.tabs')
      plugin = new $.poised.tabs(this, options)
      $this.data('poised.tabs', plugin)

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ela-4.1.6 app/js/vendor/poised/poised.tabs.coffee
ela-4.1.5 app/js/vendor/poised/poised.tabs.coffee
ela-4.1.4 app/js/vendor/poised/poised.tabs.coffee
ela-4.1.3 app/js/vendor/poised/poised.tabs.coffee
ela-4.1.2 app/js/vendor/poised/poised.tabs.coffee
ela-4.1.1 app/js/vendor/poised/poised.tabs.coffee
ela-4.1.0 app/js/vendor/poised/poised.tabs.coffee
ela-4.0.0 app/js/vendor/poised/poised.tabs.coffee
ela-3.4.3 app/js/vendor/poised/poised.tabs.coffee
ela-3.4.2 app/js/vendor/poised/poised.tabs.coffee
ela-3.4.0 app/js/vendor/poised/poised.tabs.coffee
ela-3.3.1 app/js/vendor/poised/poised.tabs.coffee
ela-3.3.0 app/js/vendor/poised/poised.tabs.coffee
ela-3.2.0 app/js/vendor/poised/poised.tabs.coffee
ela-3.1.1 app/js/vendor/poised/poised.tabs.coffee
ela-3.1.0 app/js/vendor/poised/poised.tabs.coffee
ela-3.0.0 app/js/vendor/poised/poised.tabs.coffee
ela-2.0.0 app/js/vendor/poised/poised.tabs.coffee
ela-1.1.0 app/js/vendor/poised/poised.tabs.coffee