diff options
author | Mark Otto <markdotto@gmail.com> | 2017-01-22 04:50:45 +0300 |
---|---|---|
committer | Mark Otto <markdotto@gmail.com> | 2017-01-22 04:50:45 +0300 |
commit | deb1c59c53f3a840bb1fe2794fdf9fc7d081f47f (patch) | |
tree | e2c4f179fc9e292974b757e5c2ec665245c049f1 /dist/js/bootstrap.js | |
parent | 4fa7749442ea7ab609d1c8c25dc4ba750194e542 (diff) |
grunt
Diffstat (limited to 'dist/js/bootstrap.js')
-rw-r--r-- | dist/js/bootstrap.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index 2568773326..ee87b9f88e 100644 --- a/dist/js/bootstrap.js +++ b/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; } |