From 806a82ef8326e9a7b9b21fce91b827f478298519 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 2 Jun 2012 18:06:00 -0700 Subject: add relatedTarget to carousel slide event --- js/bootstrap-carousel.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'js/bootstrap-carousel.js') diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js index 551de5891..1a82374cc 100644 --- a/js/bootstrap-carousel.js +++ b/js/bootstrap-carousel.js @@ -90,7 +90,9 @@ , direction = type == 'next' ? 'left' : 'right' , fallback = type == 'next' ? 'first' : 'last' , that = this - , e = $.Event('slide') + , e = $.Event('slide', { + relatedTarget: $next[0] + }) this.sliding = true -- cgit v1.2.3 From 555a3b0478b001022d503304d7e5a7118bf8e3a5 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 2 Jun 2012 20:28:08 -0700 Subject: fix carousel when hiding a reshowing - make sure it always triggers transition end #3248 --- js/bootstrap-carousel.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js/bootstrap-carousel.js') diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js index 1a82374cc..3938ddd6e 100644 --- a/js/bootstrap-carousel.js +++ b/js/bootstrap-carousel.js @@ -68,6 +68,10 @@ , pause: function (e) { if (!e) this.paused = true + if (this.$element.find('.next, .prev')) { + this.$element.trigger($.support.transition.end) + this.cycle() + } clearInterval(this.interval) this.interval = null return this -- cgit v1.2.3 From 3a751a63d45814cab973cd6d9ca9fddf78a1a842 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 2 Jun 2012 21:01:45 -0700 Subject: fix multi carousel bug #3194 --- js/bootstrap-carousel.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'js/bootstrap-carousel.js') diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js index 3938ddd6e..de38b4e0c 100644 --- a/js/bootstrap-carousel.js +++ b/js/bootstrap-carousel.js @@ -144,9 +144,10 @@ var $this = $(this) , data = $this.data('carousel') , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) + , action = typeof option == 'string' ? option : options.slide if (!data) $this.data('carousel', (data = new Carousel(this, options))) if (typeof option == 'number') data.to(option) - else if (typeof option == 'string' || (option = options.slide)) data[option]() + else if (action) data[action]() else if (options.interval) data.cycle() }) } -- cgit v1.2.3 From ebc1fe907d5dede1c7251dc1a25b9015a7f779d7 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 2 Jun 2012 21:09:13 -0700 Subject: only trigger $.support.transition.end when it exists --- js/bootstrap-carousel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/bootstrap-carousel.js') diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js index de38b4e0c..e0dadd213 100644 --- a/js/bootstrap-carousel.js +++ b/js/bootstrap-carousel.js @@ -68,7 +68,7 @@ , pause: function (e) { if (!e) this.paused = true - if (this.$element.find('.next, .prev')) { + if (this.$element.find('.next, .prev') && $.support.transition.end) { this.$element.trigger($.support.transition.end) this.cycle() } -- cgit v1.2.3 From 2d3a0babd242d7eebe09cf3f4daad38e2d7df6ee Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 2 Jun 2012 22:10:35 -0700 Subject: make active selector more specific #2043 and rebuild --- js/bootstrap-carousel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/bootstrap-carousel.js') diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js index e0dadd213..1bb8f5a06 100644 --- a/js/bootstrap-carousel.js +++ b/js/bootstrap-carousel.js @@ -46,7 +46,7 @@ } , to: function (pos) { - var $active = this.$element.find('.active') + var $active = this.$element.find('.item.active') , children = $active.parent().children() , activePos = children.index($active) , that = this -- cgit v1.2.3 From 31e8a358c3014d48900f4f266c75a7b62ad66dd3 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sun, 3 Jun 2012 11:24:19 -0700 Subject: check length so that pause, actually pauses --- js/bootstrap-carousel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/bootstrap-carousel.js') diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js index 1bb8f5a06..f8f3c6451 100644 --- a/js/bootstrap-carousel.js +++ b/js/bootstrap-carousel.js @@ -68,7 +68,7 @@ , pause: function (e) { if (!e) this.paused = true - if (this.$element.find('.next, .prev') && $.support.transition.end) { + if (this.$element.find('.next, .prev').length && $.support.transition.end) { this.$element.trigger($.support.transition.end) this.cycle() } -- cgit v1.2.3 From c028e333586c7ecdbc4cec6ca88ea99b26a11358 Mon Sep 17 00:00:00 2001 From: Barryvdh Date: Fri, 8 Jun 2012 16:19:08 +0300 Subject: Scope finding the .active to .item --- js/bootstrap-carousel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/bootstrap-carousel.js') diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js index f8f3c6451..3fda7c666 100644 --- a/js/bootstrap-carousel.js +++ b/js/bootstrap-carousel.js @@ -88,7 +88,7 @@ } , slide: function (type, next) { - var $active = this.$element.find('.active') + var $active = this.$element.find('.item.active') , $next = next || $active[type]() , isCycling = this.interval , direction = type == 'next' ? 'left' : 'right' -- cgit v1.2.3 From e510306196b6433dc73302d24ca58313d3a31ec7 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 19 Aug 2012 23:07:18 -0700 Subject: bump versions to 2.1.0 --- js/bootstrap-carousel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/bootstrap-carousel.js') diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js index 3fda7c666..0b87eb8a2 100644 --- a/js/bootstrap-carousel.js +++ b/js/bootstrap-carousel.js @@ -1,5 +1,5 @@ /* ========================================================== - * bootstrap-carousel.js v2.0.4 + * bootstrap-carousel.js v2.1.0 * http://twitter.github.com/bootstrap/javascript.html#carousel * ========================================================== * Copyright 2012 Twitter, Inc. -- cgit v1.2.3