aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJonathan Camile <[email protected]>2012-02-28 11:06:05 +0100
committerJonathan Camile <[email protected]>2012-02-28 11:06:05 +0100
commita397130669a1462abff703989c38a63b0d2d63f0 (patch)
tree71eab5c69724af04f68ed9fcf6edc7735e6b690a /js
parent15759d9e7c5284016f76c08065f407386ae7348a (diff)
parentfbebb046f7134eaed90492bfc67720337c4b625e (diff)
downloadbootstrap-a397130669a1462abff703989c38a63b0d2d63f0.tar.xz
bootstrap-a397130669a1462abff703989c38a63b0d2d63f0.zip
Merge branch '2.0.2-wip' of https://github.com/twitter/bootstrap into features/warning_progress_bar
Diffstat (limited to 'js')
-rw-r--r--js/bootstrap-carousel.js8
-rw-r--r--js/bootstrap-tooltip.js2
2 files changed, 7 insertions, 3 deletions
diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js
index 810256e80..e0091a7d0 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 = {
@@ -83,14 +86,14 @@
, fallback = type == 'next' ? 'first' : 'last'
, that = this
- if (!$next.length) return
-
this.sliding = true
isCycling && this.pause()
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
+ if ($next.hasClass('active')) return
+
if (!$.support.transition && this.$element.hasClass('slide')) {
this.$element.trigger('slide')
$active.removeClass('active')
@@ -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 d76e51e8c..e7bfd09bf 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
}