mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-25 12:59:05 +02:00
fix scrollspy simplify stuff more - break everything.
This commit is contained in:
21
js/bootstrap-tabs.js
vendored
21
js/bootstrap-tabs.js
vendored
@@ -1,5 +1,5 @@
|
||||
/* ========================================================
|
||||
* bootstrap-tabs.js v1.3.0
|
||||
* bootstrap-tabs.js v2.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#tabs
|
||||
* ========================================================
|
||||
* Copyright 2011 Twitter, Inc.
|
||||
@@ -21,24 +21,33 @@
|
||||
!function( $ ){
|
||||
|
||||
function activate ( element, container ) {
|
||||
container.find('> .active').removeClass('active')
|
||||
container
|
||||
.find('> .active')
|
||||
.removeClass('active')
|
||||
.find('> .dropdown-menu > .active')
|
||||
.removeClass('active')
|
||||
|
||||
element.addClass('active')
|
||||
|
||||
if ( element.parent('.dropdown-menu') ) {
|
||||
element.closest('li.dropdown').addClass('active')
|
||||
}
|
||||
}
|
||||
|
||||
function tab( e ) {
|
||||
var $this = $(this)
|
||||
, $ul = $this.closest('ul')
|
||||
, $ul = $this.closest('ul:not(.dropdown-menu)')
|
||||
, href = $this.attr('href')
|
||||
, previous
|
||||
|
||||
if (/^#\w+/.test(href)) {
|
||||
if ( /^#\w+/.test(href) ) {
|
||||
e.preventDefault()
|
||||
|
||||
if ($this.parent('li').hasClass('active')) {
|
||||
if ( $this.parent('li').hasClass('active') ) {
|
||||
return
|
||||
}
|
||||
|
||||
previous = $ul.find('.active a')[0]
|
||||
previous = $ul.find('.active a').last()[0]
|
||||
$href = $(href)
|
||||
|
||||
activate($this.parent('li'), $ul)
|
||||
|
Reference in New Issue
Block a user