diff options
| author | Mark Otto <[email protected]> | 2016-06-02 21:48:53 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2016-06-02 21:48:53 -0700 |
| commit | 8feae9075ae55be4e6cd0e884fbfa006a6639ceb (patch) | |
| tree | 0124594afc748b650fbe2f840b1e8d4cabc841cf /js/src/carousel.js | |
| parent | 96835e1512631a1a54e99e1179e06d2e23060705 (diff) | |
| parent | 0b4187d37b8fb1a65a5929329b51b04a2d6aa1eb (diff) | |
| download | bootstrap-8feae9075ae55be4e6cd0e884fbfa006a6639ceb.tar.xz bootstrap-8feae9075ae55be4e6cd0e884fbfa006a6639ceb.zip | |
Merge branch 'v4-dev' of https://github.com/twbs/bootstrap into v4-dev
Diffstat (limited to 'js/src/carousel.js')
| -rw-r--r-- | js/src/carousel.js | 6 |
1 files changed, 4 insertions, 2 deletions
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 } } |
