From bccc2cb7191eb54a4d67563625a748d7ecd381d4 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 24 Mar 2012 18:20:09 -0700 Subject: add preventDefault support for all inital event types (show, close, hide, etc.) + fix small bug with scrollspy.last --- js/bootstrap-tab.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'js/bootstrap-tab.js') 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) -- cgit v1.2.3 From f02d017ffa2f63609db034410979f62fde328816 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 24 Mar 2012 18:59:04 -0700 Subject: return matcher value directly + cleanup first lines of files --- js/bootstrap-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/bootstrap-tab.js') diff --git a/js/bootstrap-tab.js b/js/bootstrap-tab.js index 974cc0aca..d46ef790a 100644 --- a/js/bootstrap-tab.js +++ b/js/bootstrap-tab.js @@ -18,7 +18,7 @@ * ======================================================== */ -!function( $ ){ +!function ( $ ) { "use strict" -- cgit v1.2.3 From 575f18aaf49abb0289185f6409bee031947ccf69 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 14 Apr 2012 16:29:53 -0700 Subject: add jshint support + a few minor stylistic changes --- js/bootstrap-tab.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'js/bootstrap-tab.js') diff --git a/js/bootstrap-tab.js b/js/bootstrap-tab.js index d46ef790a..6255d53ef 100644 --- a/js/bootstrap-tab.js +++ b/js/bootstrap-tab.js @@ -18,9 +18,10 @@ * ======================================================== */ -!function ( $ ) { +!function ($) { + + "use strict"; // jshint ;_; - "use strict" /* TAB CLASS DEFINITION * ==================== */ @@ -131,4 +132,4 @@ }) }) -}( window.jQuery ); \ No newline at end of file +}(window.jQuery); \ No newline at end of file -- cgit v1.2.3 From 839ef3a030b355d0f0c35d6c9e42ecba8b072036 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Tue, 24 Apr 2012 02:19:02 -0700 Subject: 2.0.2 -> 2.0.3 --- js/bootstrap-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/bootstrap-tab.js') diff --git a/js/bootstrap-tab.js b/js/bootstrap-tab.js index 6255d53ef..88641de86 100644 --- a/js/bootstrap-tab.js +++ b/js/bootstrap-tab.js @@ -1,5 +1,5 @@ /* ======================================================== - * bootstrap-tab.js v2.0.2 + * bootstrap-tab.js v2.0.3 * http://twitter.github.com/bootstrap/javascript.html#tabs * ======================================================== * Copyright 2012 Twitter, Inc. -- cgit v1.2.3