2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-14 18:42:30 +03:00

Added changed event to bootstrap-tabs.js

This commit is contained in:
Kasper Bøgebjerg Pedersen
2011-09-18 10:15:24 +02:00
parent 3eafbe5c89
commit e16de59260
3 changed files with 53 additions and 9 deletions
+3 -1
View File
@@ -30,11 +30,12 @@
, href = $this.attr('href')
, $ul = $(e.liveFired)
, $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})
}
}