aboutsummaryrefslogtreecommitdiff
path: root/js/bootstrap-tab.js
diff options
context:
space:
mode:
authorJacob Thornton <[email protected]>2012-03-24 18:20:09 -0700
committerJacob Thornton <[email protected]>2012-03-24 18:20:09 -0700
commitbccc2cb7191eb54a4d67563625a748d7ecd381d4 (patch)
treec4562643867c197b7f7f5792694e3e10aab8de52 /js/bootstrap-tab.js
parentef5ac02b698ffab3a42d21f20859b70df85543c0 (diff)
downloadbootstrap-bccc2cb7191eb54a4d67563625a748d7ecd381d4.tar.xz
bootstrap-bccc2cb7191eb54a4d67563625a748d7ecd381d4.zip
add preventDefault support for all inital event types (show, close, hide, etc.) + fix small bug with scrollspy.last
Diffstat (limited to 'js/bootstrap-tab.js')
-rw-r--r--js/bootstrap-tab.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/js/bootstrap-tab.js b/js/bootstrap-tab.js
index b3938f671..974cc0aca 100644
--- a/js/bootstrap-tab.js
+++ b/js/bootstrap-tab.js
@@ -39,6 +39,7 @@
, selector = $this.attr('data-target')
, previous
, $target
+ , e
if (!selector) {
selector = $this.attr('href')
@@ -49,11 +50,14 @@
previous = $ul.find('.active a').last()[0]
- $this.trigger({
- type: 'show'
- , relatedTarget: previous
+ e = $.Event('show', {
+ relatedTarget: previous
})
+ $this.trigger(e)
+
+ if (e.isDefaultPrevented()) return
+
$target = $(selector)
this.activate($this.parent('li'), $ul)