diff --git a/docs/_themes/basicstrap/static/js/bootstrap.js b/docs/_themes/basicstrap/static/js/bootstrap.js index 6c15a583..671f61e9 100755 --- a/docs/_themes/basicstrap/static/js/bootstrap.js +++ b/docs/_themes/basicstrap/static/js/bootstrap.js @@ -100,7 +100,7 @@ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 } - $parent = $(selector) + $parent = $(document).find(selector) e && e.preventDefault() @@ -436,8 +436,14 @@ * ================= */ $(document).on('click.carousel.data-api', '[data-slide]', function (e) { - var $this = $(this), href - , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + var $this = $(this) + var href = $this.attr('href') + if (href) { + href = href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 + } + + var target = $this.attr('data-target') || href + var $target = $(document).find(target) , options = $.extend({}, $target.data(), $this.data()) $target.carousel(options) e.preventDefault() @@ -726,7 +732,7 @@ selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 } - $parent = $(selector) + $parent = $(document).find(selector) $parent.length || ($parent = $this.parent()) return $parent @@ -1001,7 +1007,10 @@ $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) { var $this = $(this) , href = $this.attr('href') - , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7 + var target = $this.attr('data-target') || + (href && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 + + var $target = $(document).find(target) , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data()) e.preventDefault()