aboutsummaryrefslogtreecommitdiff
path: root/js/bootstrap-tabs.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/bootstrap-tabs.js')
-rw-r--r--js/bootstrap-tabs.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/js/bootstrap-tabs.js b/js/bootstrap-tabs.js
index 807b366a3..b94adfc25 100644
--- a/js/bootstrap-tabs.js
+++ b/js/bootstrap-tabs.js
@@ -18,30 +18,36 @@
* ======================================================== */
-(function( $ ){
+!function( $ ){
function activate ( element, container ) {
- container.find('.active').removeClass('active')
+ container.find('> .active').removeClass('active')
element.addClass('active')
}
function tab( e ) {
var $this = $(this)
+ , $ul = $this.closest('ul')
, href = $this.attr('href')
- , $ul = $(e.liveFired)
- , $controlled
+ , previous
if (/^#\w+/.test(href)) {
e.preventDefault()
- if ($this.hasClass('active')) {
+ if ($this.parent('li').hasClass('active')) {
return
}
+ previous = $ul.find('.active a')[0]
$href = $(href)
activate($this.parent('li'), $ul)
activate($href, $href.parent())
+
+ $this.trigger({
+ type: 'change'
+ , relatedTarget: previous
+ })
}
}
@@ -59,4 +65,4 @@
$('body').tabs('ul[data-tabs] li > a, ul[data-pills] > li > a')
})
-})( window.jQuery || window.ender ) \ No newline at end of file
+}( window.jQuery || window.ender ); \ No newline at end of file