diff --git a/docs/assets/bootstrap.zip b/docs/assets/bootstrap.zip index 7a94384807..63f92b76f2 100644 Binary files a/docs/assets/bootstrap.zip and b/docs/assets/bootstrap.zip differ diff --git a/docs/assets/js/bootstrap-carousel.js b/docs/assets/js/bootstrap-carousel.js index aef98fb05a..e0091a7d0a 100644 --- a/docs/assets/js/bootstrap-carousel.js +++ b/docs/assets/js/bootstrap-carousel.js @@ -29,6 +29,9 @@ this.$element = $(element) this.options = $.extend({}, $.fn.carousel.defaults, options) this.options.slide && this.slide(this.options.slide) + this.options.pause == 'hover' && this.$element + .on('mouseenter', $.proxy(this.pause, this)) + .on('mouseleave', $.proxy(this.cycle, this)) } Carousel.prototype = { @@ -136,6 +139,7 @@ $.fn.carousel.defaults = { interval: 5000 + , pause: 'hover' } $.fn.carousel.Constructor = Carousel diff --git a/docs/assets/js/bootstrap-tooltip.js b/docs/assets/js/bootstrap-tooltip.js index d76e51e8c9..e7bfd09bf2 100644 --- a/docs/assets/js/bootstrap-tooltip.js +++ b/docs/assets/js/bootstrap-tooltip.js @@ -206,7 +206,7 @@ title = $e.attr('data-original-title') || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) - title = title.toString().replace(/(^\s*|\s*$)/, "") + title = (title || '').toString().replace(/(^\s*|\s*$)/, "") return title } diff --git a/docs/javascript.html b/docs/javascript.html index 4f40934f7b..c64a85b536 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -1310,6 +1310,12 @@ $('#myCollapsible').on('hidden', function () { 5000 The amount of time to delay between automatically cycling an item. + + pause + string + "hover" + Pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave. +

Markup

diff --git a/docs/templates/pages/javascript.mustache b/docs/templates/pages/javascript.mustache index aa3a280f43..c88b4296a0 100644 --- a/docs/templates/pages/javascript.mustache +++ b/docs/templates/pages/javascript.mustache @@ -1234,6 +1234,12 @@ $('#myCollapsible').on('hidden', function () { 5000 {{_i}}The amount of time to delay between automatically cycling an item.{{/i}} + + {{_i}}pause{{/i}} + {{_i}}string{{/i}} + "hover" + {{_i}}Pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave.{{/i}} +

{{_i}}Markup{{/i}}

diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js index aef98fb05a..e0091a7d0a 100644 --- a/js/bootstrap-carousel.js +++ b/js/bootstrap-carousel.js @@ -29,6 +29,9 @@ this.$element = $(element) this.options = $.extend({}, $.fn.carousel.defaults, options) this.options.slide && this.slide(this.options.slide) + this.options.pause == 'hover' && this.$element + .on('mouseenter', $.proxy(this.pause, this)) + .on('mouseleave', $.proxy(this.cycle, this)) } Carousel.prototype = { @@ -136,6 +139,7 @@ $.fn.carousel.defaults = { interval: 5000 + , pause: 'hover' } $.fn.carousel.Constructor = Carousel diff --git a/js/bootstrap-tooltip.js b/js/bootstrap-tooltip.js index d76e51e8c9..e7bfd09bf2 100644 --- a/js/bootstrap-tooltip.js +++ b/js/bootstrap-tooltip.js @@ -206,7 +206,7 @@ title = $e.attr('data-original-title') || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) - title = title.toString().replace(/(^\s*|\s*$)/, "") + title = (title || '').toString().replace(/(^\s*|\s*$)/, "") return title }