vendor/assets/javascripts/bootstrap/bootstrap-tab.js in jombo-1.0.2 vs vendor/assets/javascripts/bootstrap/bootstrap-tab.js in jombo-1.0.3

- old
+ new

@@ -16,14 +16,15 @@ * See the License for the specific language governing permissions and * limitations under the License. * ======================================================== */ -!function( $ ){ +!function ($) { - "use strict" + "use strict"; // jshint ;_; + /* TAB CLASS DEFINITION * ==================== */ var Tab = function ( element ) { this.element = $(element) @@ -37,25 +38,29 @@ var $this = this.element , $ul = $this.closest('ul:not(.dropdown-menu)') , selector = $this.attr('data-target') , previous , $target + , e if (!selector) { selector = $this.attr('href') selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 } if ( $this.parent('li').hasClass('active') ) return 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) this.activate($target, $target.parent(), function () { $this.trigger({ @@ -125,6 +130,6 @@ e.preventDefault() $(this).tab('show') }) }) -}( window.jQuery ); +}(window.jQuery); \ No newline at end of file