diff options
| author | Ben-Russell <[email protected]> | 2014-08-26 14:34:21 -0700 |
|---|---|---|
| committer | Heinrich Fenkart <[email protected]> | 2014-10-29 04:54:53 +0100 |
| commit | 68b771a057b60ca5740cf9a1b0f8f9ec73e5dc56 (patch) | |
| tree | 51bd082eedc237e1aca1e9bd532f4e7c83292709 /js/carousel.js | |
| parent | 94b544c22940d8048e7ecda9f3484583894f45c5 (diff) | |
| download | bootstrap-68b771a057b60ca5740cf9a1b0f8f9ec73e5dc56.tar.xz bootstrap-68b771a057b60ca5740cf9a1b0f8f9ec73e5dc56.zip | |
Independently delegate data-api selectors
Fixes #14462.
Closes #14463 by merging it.
Diffstat (limited to 'js/carousel.js')
| -rw-r--r-- | js/carousel.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/js/carousel.js b/js/carousel.js index b68899009..8884424ef 100644 --- a/js/carousel.js +++ b/js/carousel.js @@ -207,7 +207,7 @@ // CAROUSEL DATA-API // ================= - $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { + var clickHandler = function (e) { var href var $this = $(this) var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 @@ -223,7 +223,11 @@ } e.preventDefault() - }) + } + + $(document) + .on('click.bs.carousel.data-api', '[data-slide]', clickHandler) + .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler) $(window).on('load', function () { $('[data-ride="carousel"]').each(function () { |
