diff options
| author | Mark Otto <[email protected]> | 2017-01-21 17:50:45 -0800 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2017-01-21 17:50:45 -0800 |
| commit | deb1c59c53f3a840bb1fe2794fdf9fc7d081f47f (patch) | |
| tree | e2c4f179fc9e292974b757e5c2ec665245c049f1 /docs/dist/js/bootstrap.js | |
| parent | 4fa7749442ea7ab609d1c8c25dc4ba750194e542 (diff) | |
| download | bootstrap-deb1c59c53f3a840bb1fe2794fdf9fc7d081f47f.tar.xz bootstrap-deb1c59c53f3a840bb1fe2794fdf9fc7d081f47f.zip | |
grunt
Diffstat (limited to 'docs/dist/js/bootstrap.js')
| -rw-r--r-- | docs/dist/js/bootstrap.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/docs/dist/js/bootstrap.js b/docs/dist/js/bootstrap.js index 256877332..ee87b9f88 100644 --- a/docs/dist/js/bootstrap.js +++ b/docs/dist/js/bootstrap.js @@ -645,7 +645,7 @@ var Carousel = function ($) { if (this._isSliding) { throw new Error('Carousel is sliding'); } - this._slide(Direction.PREVIOUS); + this._slide(Direction.PREV); }; Carousel.prototype.pause = function pause(event) { @@ -701,7 +701,7 @@ var Carousel = function ($) { return; } - var direction = index > activeIndex ? Direction.NEXT : Direction.PREVIOUS; + var direction = index > activeIndex ? Direction.NEXT : Direction.PREV; this._slide(direction, this._items[index]); }; @@ -772,7 +772,7 @@ var Carousel = function ($) { Carousel.prototype._getItemByDirection = function _getItemByDirection(direction, activeElement) { var isNextDirection = direction === Direction.NEXT; - var isPrevDirection = direction === Direction.PREVIOUS; + var isPrevDirection = direction === Direction.PREV; var activeIndex = this._getItemIndex(activeElement); var lastItemIndex = this._items.length - 1; var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; @@ -781,7 +781,7 @@ var Carousel = function ($) { return activeElement; } - var delta = direction === Direction.PREVIOUS ? -1 : 1; + var delta = direction === Direction.PREV ? -1 : 1; var itemIndex = (activeIndex + delta) % this._items.length; return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; @@ -1374,9 +1374,11 @@ var Dropdown = function ($) { var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key + var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) + var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + '|' + ARROW_DOWN_KEYCODE + '|' + ESCAPE_KEYCODE + '|' + SPACE_KEYCODE); var Event = { HIDE: 'hide' + EVENT_KEY, @@ -1549,7 +1551,7 @@ var Dropdown = function ($) { }; Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { - if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) { + if (!REGEXP_KEYDOWN.test(event.which) || /input|textarea/i.test(event.target.tagName)) { return; } |
