From 5a35ad6d74c8d9e5aa99a1fc255300a8fd2ac0b4 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Mon, 30 May 2016 23:42:00 -0700 Subject: Use named constants for magic numbers (#19992) Mostly KeyboardEvent.which and MouseEvent.which values. [skip validator] --- js/src/carousel.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'js/src/carousel.js') diff --git a/js/src/carousel.js b/js/src/carousel.js index 34cab4391..f990c699a 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -24,6 +24,8 @@ const Carousel = (($) => { const DATA_API_KEY = '.data-api' const JQUERY_NO_CONFLICT = $.fn[NAME] const TRANSITION_DURATION = 600 + const ARROW_LEFT_KEYCODE = 37 // KeyboardEvent.which value for left arrow key + const ARROW_RIGHT_KEYCODE = 39 // KeyboardEvent.which value for right arrow key const Default = { interval : 5000, @@ -236,8 +238,8 @@ const Carousel = (($) => { } switch (event.which) { - case 37: this.prev(); break - case 39: this.next(); break + case ARROW_LEFT_KEYCODE: this.prev(); break + case ARROW_RIGHT_KEYCODE: this.next(); break default: return } } -- cgit v1.2.3 From 2b16f5c5100c8a42bccad028903eadac2875e20c Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Sat, 4 Jun 2016 14:28:34 -0700 Subject: Update ESLint to v2.5.3 (#20043) Refs #19908. [skip sauce] [skip validator] --- js/src/carousel.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'js/src/carousel.js') diff --git a/js/src/carousel.js b/js/src/carousel.js index f990c699a..e24aed08f 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -238,9 +238,14 @@ const Carousel = (($) => { } switch (event.which) { - case ARROW_LEFT_KEYCODE: this.prev(); break - case ARROW_RIGHT_KEYCODE: this.next(); break - default: return + case ARROW_LEFT_KEYCODE: + this.prev() + break + case ARROW_RIGHT_KEYCODE: + this.next() + break + default: + return } } -- cgit v1.2.3 From 24e992a6ffbb3b54424eb1042d49005124b265d9 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 27 Jul 2016 09:31:24 -0700 Subject: bump versions --- js/src/carousel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/src/carousel.js') diff --git a/js/src/carousel.js b/js/src/carousel.js index e24aed08f..e2a6537bf 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -3,7 +3,7 @@ import Util from './util' /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-alpha.2): carousel.js + * Bootstrap (v4.0.0-alpha.3): carousel.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -18,7 +18,7 @@ const Carousel = (($) => { */ const NAME = 'carousel' - const VERSION = '4.0.0-alpha.2' + const VERSION = '4.0.0-alpha.3' const DATA_KEY = 'bs.carousel' const EVENT_KEY = `.${DATA_KEY}` const DATA_API_KEY = '.data-api' -- cgit v1.2.3 From 5495a4b3d383c745065a177d3adb8e5db94acd7f Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 5 Sep 2016 12:41:44 -0700 Subject: versions --- js/src/carousel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/src/carousel.js') diff --git a/js/src/carousel.js b/js/src/carousel.js index e2a6537bf..ff00d8aaf 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -3,7 +3,7 @@ import Util from './util' /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-alpha.3): carousel.js + * Bootstrap (v4.0.0-alpha.4): carousel.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -18,7 +18,7 @@ const Carousel = (($) => { */ const NAME = 'carousel' - const VERSION = '4.0.0-alpha.3' + const VERSION = '4.0.0-alpha.4' const DATA_KEY = 'bs.carousel' const EVENT_KEY = `.${DATA_KEY}` const DATA_API_KEY = '.data-api' -- cgit v1.2.3