From 7b0acf14d8a7c7c6089035a848cba540ed963f36 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Mon, 17 Mar 2014 09:12:55 +0200 Subject: Comply to the new style. --- js/carousel.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js/carousel.js') diff --git a/js/carousel.js b/js/carousel.js index 2a94a9838..56aa8eb91 100644 --- a/js/carousel.js +++ b/js/carousel.js @@ -103,7 +103,7 @@ $next = this.$element.find('.item')[fallback]() } - if ($next.hasClass('active')) return this.sliding = false + if ($next.hasClass('active')) return (this.sliding = false) var relatedTarget = $next[0] var slideEvent = $.Event('slide.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) @@ -185,7 +185,8 @@ // ================= $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { - var $this = $(this), href + var href + var $this = $(this) var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 var options = $.extend({}, $target.data(), $this.data()) var slideIndex = $this.attr('data-slide-to') -- cgit v1.2.3 From 82fc03f3b6caccd134827a83c346456b920f4ba8 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 22 May 2014 09:48:17 +0300 Subject: carousel.js: remove unneeded variable assignment. `slideIndex` is assigned to the same value a few lines above. --- js/carousel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/carousel.js') diff --git a/js/carousel.js b/js/carousel.js index 56aa8eb91..bda09543f 100644 --- a/js/carousel.js +++ b/js/carousel.js @@ -194,7 +194,7 @@ Plugin.call($target, options) - if (slideIndex = $this.attr('data-slide-to')) { + if (slideIndex) { $target.data('bs.carousel').to(slideIndex) } -- cgit v1.2.3 From e2cabe4971927e3dbbbda4c81ae8f74abdee2d15 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 29 May 2014 07:35:22 +0300 Subject: Minor style tweaks. --- js/carousel.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'js/carousel.js') diff --git a/js/carousel.js b/js/carousel.js index bda09543f..e2cb67a5e 100644 --- a/js/carousel.js +++ b/js/carousel.js @@ -36,7 +36,7 @@ wrap: true } - Carousel.prototype.cycle = function (e) { + Carousel.prototype.cycle = function (e) { e || (this.paused = false) this.interval && clearInterval(this.interval) @@ -106,7 +106,10 @@ if ($next.hasClass('active')) return (this.sliding = false) var relatedTarget = $next[0] - var slideEvent = $.Event('slide.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) + var slideEvent = $.Event('slide.bs.carousel', { + relatedTarget: relatedTarget, + direction: direction + }) this.$element.trigger(slideEvent) if (slideEvent.isDefaultPrevented()) return @@ -133,7 +136,9 @@ $next.removeClass([type, direction].join(' ')).addClass('active') $active.removeClass(['active', direction].join(' ')) that.sliding = false - setTimeout(function () { that.$element.trigger(slidEvent) }, 0) + setTimeout(function () { + that.$element.trigger(slidEvent) + }, 0) }) .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000) } else { -- cgit v1.2.3