aboutsummaryrefslogtreecommitdiff
path: root/js/bootstrap-tab.js
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2012-01-28 11:22:07 -0800
committerMark Otto <[email protected]>2012-01-28 11:22:07 -0800
commit245276825924acd0cfe5f4fd57b0f8b9970b64c3 (patch)
tree5d803eec9195de7e19dac304f05eddd1895bc914 /js/bootstrap-tab.js
parent28ba9d69c82895bbd9a1d66cea855119f4aba349 (diff)
parentc2c02d104c5e5a96330cf00a727d62687d863e02 (diff)
downloadbootstrap-245276825924acd0cfe5f4fd57b0f8b9970b64c3.tar.xz
bootstrap-245276825924acd0cfe5f4fd57b0f8b9970b64c3.zip
Merge branch '2.0-wip' of github.com:twitter/bootstrap into 2.0-wip
Diffstat (limited to 'js/bootstrap-tab.js')
-rw-r--r--js/bootstrap-tab.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/js/bootstrap-tab.js b/js/bootstrap-tab.js
index 95698d23e..f19db5da1 100644
--- a/js/bootstrap-tab.js
+++ b/js/bootstrap-tab.js
@@ -36,9 +36,14 @@
, 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
@@ -49,10 +54,10 @@
, 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