Skip to content

Commit

Permalink
Tab extension : support nav-pills
Browse files Browse the repository at this point in the history
  • Loading branch information
rohk committed Jun 3, 2014
1 parent d224172 commit f203dea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/js/bootstrap-accessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
// Tab Extension
// ===============================

var $tablist = $('.nav-tabs')
var $tablist = $('.nav-tabs, .nav-pills')
, $lis = $tablist.children('li')
, $tabs = $tablist.find('[data-toggle="tab"], [data-toggle="pill"]')

Expand Down Expand Up @@ -194,13 +194,13 @@
var tabactivate = $.fn.tab.Constructor.prototype.activate;
$.fn.tab.Constructor.prototype.activate = function (element, container, callback) {
var $active = container.find('> .active')
$active.find('[data-toggle=tab]').attr({ 'tabIndex' : '-1','aria-selected' : false })
$active.find('[data-toggle=tab], [data-toggle=pill]').attr({ 'tabIndex' : '-1','aria-selected' : false })
$active.filter('.tab-pane').attr({ 'aria-hidden' : true,'tabIndex' : '-1' })

tabactivate.apply(this, arguments)

element.addClass('active')
element.find('[data-toggle=tab]').attr({ 'tabIndex' : '0','aria-selected' : true })
element.find('[data-toggle=tab], [data-toggle=pill]').attr({ 'tabIndex' : '0','aria-selected' : true })
element.filter('.tab-pane').attr({ 'aria-hidden' : false,'tabIndex' : '0' })
}

Expand Down

0 comments on commit f203dea

Please sign in to comment.