diff options
| author | Jacob Thornton <[email protected]> | 2012-04-18 13:35:14 -0700 |
|---|---|---|
| committer | Jacob Thornton <[email protected]> | 2012-04-18 13:35:14 -0700 |
| commit | bc07e2adae7bc61795d54681915d791aee41c49a (patch) | |
| tree | 548742b36162ed9a251d02963ef628125f80508e /docs/assets/js/bootstrap.js | |
| parent | b627898919bcd17cafe5b1cae69c555ebb9a769e (diff) | |
| download | bootstrap-bc07e2adae7bc61795d54681915d791aee41c49a.tar.xz bootstrap-bc07e2adae7bc61795d54681915d791aee41c49a.zip | |
allow for pushstate in scrollspy
Diffstat (limited to 'docs/assets/js/bootstrap.js')
| -rw-r--r-- | docs/assets/js/bootstrap.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/docs/assets/js/bootstrap.js b/docs/assets/js/bootstrap.js index c2cc64889..45f8189b2 100644 --- a/docs/assets/js/bootstrap.js +++ b/docs/assets/js/bootstrap.js @@ -1309,7 +1309,8 @@ $targets = this.$body .find(this.selector) .map(function () { - var href = $(this).attr('href') + var $el = $(this) + , href = $el.data('target') || $el.attr('href') , $href = /^#\w/.test(href) && $(href) return ( $href && href.length @@ -1346,6 +1347,7 @@ , activate: function (target) { var active + , selector this.activeTarget = target @@ -1353,7 +1355,11 @@ .parent('.active') .removeClass('active') - active = $(this.selector + '[href="' + target + '"]') + selector = this.selector + + '[data-target="' + target + '"],' + + this.selector + '[href="' + target + '"]' + + active = $(selector) .parent('li') .addClass('active') |
