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