Sha256: 7988a66974f53266eab108a6ff7e734153643eb1fc27fe7839b306d9cbb8c74f
Contents?: true
Size: 1.42 KB
Versions: 19
Compression:
Stored size: 1.42 KB
Contents
(function() { $.poised = {}; $.poised.tabs = function(element, options) { var $element, plugin; plugin = this; plugin.settings = {}; $element = $(element); element = element; plugin.init = function() { var $header, $headerTabs, updateActiveTab; $header = $element.find('header '); $headerTabs = $header.find('.tab'); updateActiveTab = function(active) { var $activeTab; active || (active = $element.find('.tab-content.active').attr('data-tab') || $element.find('.tab-content').first().attr('data-tab')); $element.find('.tab, .tab-content').each(function(elem) { var $el, id; $el = $(this); id = $el.attr('data-tab-view') || $el.attr('data-tab'); return $el.toggleClass('active', id === active); }); return $activeTab = $header.find("[data-tab-view=" + active + "]"); }; $headerTabs.on('tap', function(e) { return updateActiveTab($(e.target).attr('data-tab-view')); }); return updateActiveTab(); }; return plugin.init(); }; $.fn.poisedTabs = function(options) { if (options == null) { options = {}; } return this.each(function() { var $this, plugin; $this = $(this); if (!$this.data('poised.tabs')) { plugin = new $.poised.tabs(this, options); return $this.data('poised.tabs', plugin); } }); }; }).call(this);
Version data entries
19 entries across 19 versions & 1 rubygems