vendor/assets/javascripts/bootstrap/bootstrap-tab.js in jombo-0.0.1.beta25 vs vendor/assets/javascripts/bootstrap/bootstrap-tab.js in jombo-0.0.1.beta26

- old
+ new

@@ -1,7 +1,7 @@ /* ======================================================== - * bootstrap-tabs.js v2.0.0 + * bootstrap-tab.js v2.0.0 * http://twitter.github.com/bootstrap/javascript.html#tabs * ======================================================== * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -34,27 +34,32 @@ constructor: Tab , show: function () { var $this = this.element , $ul = $this.closest('ul:not(.dropdown-menu)') - , href = $this.attr('data-target') || $this.attr('href') + , selector = $this.attr('data-target') , previous - , $href + , $target + 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 }) - $href = $(href) + $target = $(selector) this.activate($this.parent('li'), $ul) - this.activate($href, $href.parent(), function () { + this.activate($target, $target.parent(), function () { $this.trigger({ type: 'shown' , relatedTarget: previous }) }) @@ -120,6 +125,6 @@ e.preventDefault() $(this).tab('show') }) }) -}( window.jQuery ) \ No newline at end of file +}( window.jQuery )