1
0
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:
Jacob Thornton
2011-10-19 23:12:50 -07:00
parent 5ab84f942d
commit 523e02f7df
10 changed files with 78 additions and 57 deletions

21
js/bootstrap-tabs.js vendored
View File

@@ -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)