mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-25 21:09:06 +02:00
Merge branch 'tab-event' of https://github.com/kasperp/bootstrap into kasperp-tab-event
This commit is contained in:
6
js/bootstrap-tabs.js
vendored
6
js/bootstrap-tabs.js
vendored
@@ -30,11 +30,12 @@
|
||||
, href = $this.attr('href')
|
||||
, $ul = $this.closest('ul')
|
||||
, $controlled
|
||||
, current = $ul.find('.active a').attr('href')
|
||||
|
||||
if (/^#\w+/.test(href)) {
|
||||
e.preventDefault()
|
||||
|
||||
if ($this.hasClass('active')) {
|
||||
if ($this.parent('li').hasClass('active')) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -42,6 +43,7 @@
|
||||
|
||||
activate($this.parent('li'), $ul)
|
||||
activate($href, $href.parent())
|
||||
$this.trigger("changed", {from:current, to:href})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,4 +61,4 @@
|
||||
$('body').tabs('ul[data-tabs] li > a, ul[data-pills] > li > a')
|
||||
})
|
||||
|
||||
}( window.jQuery || window.ender );
|
||||
}( window.jQuery || window.ender );
|
||||
|
Reference in New Issue
Block a user