Skip to content

Commit ba312c2

Browse files
committed
build
1 parent 638b97f commit ba312c2

28 files changed

+155
-47
lines changed

dist/css/bootstrap.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/bootstrap.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/bootstrap.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/bootstrap.min.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/bootstrap.js

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@ if (typeof jQuery === 'undefined') {
88
throw new Error('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.')
99
}
1010

11-
+function ($) {
11+
(function ($) {
1212
var version = $.fn.jquery.split(' ')[0].split('.')
1313
if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] >= 4)) {
1414
throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')
1515
}
16-
}(jQuery);
17-
18-
19-
+function () {
16+
})(jQuery);
2017

18+
(function () {
2119
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
2220

2321
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
@@ -551,6 +549,7 @@ var Carousel = function ($) {
551549
var TRANSITION_DURATION = 600;
552550
var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
553551
var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
552+
var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
554553

555554
var Default = {
556555
interval: 5000,
@@ -581,6 +580,7 @@ var Carousel = function ($) {
581580
KEYDOWN: 'keydown' + EVENT_KEY,
582581
MOUSEENTER: 'mouseenter' + EVENT_KEY,
583582
MOUSELEAVE: 'mouseleave' + EVENT_KEY,
583+
TOUCHEND: 'touchend' + EVENT_KEY,
584584
LOAD_DATA_API: 'load' + EVENT_KEY + DATA_API_KEY,
585585
CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
586586
};
@@ -623,6 +623,8 @@ var Carousel = function ($) {
623623
this._isPaused = false;
624624
this._isSliding = false;
625625

626+
this.touchTimeout = null;
627+
626628
this._config = this._getConfig(config);
627629
this._element = $(element)[0];
628630
this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0];
@@ -742,12 +744,30 @@ var Carousel = function ($) {
742744
});
743745
}
744746

745-
if (this._config.pause === 'hover' && !('ontouchstart' in document.documentElement)) {
747+
if (this._config.pause === 'hover') {
746748
$(this._element).on(Event.MOUSEENTER, function (event) {
747749
return _this4.pause(event);
748750
}).on(Event.MOUSELEAVE, function (event) {
749751
return _this4.cycle(event);
750752
});
753+
if ('ontouchstart' in document.documentElement) {
754+
// if it's a touch-enabled device, mouseenter/leave are fired as
755+
// part of the mouse compatibility events on first tap - the carousel
756+
// would stop cycling until user tapped out of it;
757+
// here, we listen for touchend, explicitly pause the carousel
758+
// (as if it's the second time we tap on it, mouseenter compat event
759+
// is NOT fired) and after a timeout (to allow for mouse compatibility
760+
// events to fire) we explicitly restart cycling
761+
$(this._element).on(Event.TOUCHEND, function () {
762+
_this4.pause();
763+
if (_this4.touchTimeout) {
764+
clearTimeout(_this4.touchTimeout);
765+
}
766+
_this4.touchTimeout = setTimeout(function (event) {
767+
return _this4.cycle(event);
768+
}, TOUCHEVENT_COMPAT_WAIT + _this4._config.interval);
769+
});
770+
}
751771
}
752772
};
753773

@@ -1463,7 +1483,7 @@ var Dropdown = function ($) {
14631483
// only needed because of broken event delegation on iOS
14641484
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
14651485
if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) {
1466-
$('body').children().on('mouseover', '*', $.noop);
1486+
$('body').children().on('mouseover', null, $.noop);
14671487
}
14681488

14691489
this.focus();
@@ -1537,7 +1557,7 @@ var Dropdown = function ($) {
15371557
// if this is a touch-enabled device we remove the extra
15381558
// empty mouseover listeners we added for iOS support
15391559
if ('ontouchstart' in document.documentElement) {
1540-
$('body').children().off('mouseover', '*', $.noop);
1560+
$('body').children().off('mouseover', null, $.noop);
15411561
}
15421562

15431563
toggles[i].setAttribute('aria-expanded', 'false');
@@ -3041,6 +3061,14 @@ var Tooltip = function ($) {
30413061

30423062
$(tip).addClass(ClassName.SHOW);
30433063

3064+
// if this is a touch-enabled device we add extra
3065+
// empty mouseover listeners to the body's immediate children;
3066+
// only needed because of broken event delegation on iOS
3067+
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
3068+
if ('ontouchstart' in document.documentElement) {
3069+
$('body').children().on('mouseover', null, $.noop);
3070+
}
3071+
30443072
var complete = function complete() {
30453073
var prevHoverState = _this23._hoverState;
30463074
_this23._hoverState = null;
@@ -3089,6 +3117,12 @@ var Tooltip = function ($) {
30893117

30903118
$(tip).removeClass(ClassName.SHOW);
30913119

3120+
// if this is a touch-enabled device we remove the extra
3121+
// empty mouseover listeners we added for iOS support
3122+
if ('ontouchstart' in document.documentElement) {
3123+
$('body').children().off('mouseover', null, $.noop);
3124+
}
3125+
30923126
this._activeTrigger[Trigger.CLICK] = false;
30933127
this._activeTrigger[Trigger.FOCUS] = false;
30943128
this._activeTrigger[Trigger.HOVER] = false;
@@ -3593,4 +3627,5 @@ var Popover = function ($) {
35933627
return Popover;
35943628
}(jQuery);
35953629

3596-
}();
3630+
3631+
})()

dist/js/bootstrap.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/css/docs.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/css/docs.min.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/dist/css/bootstrap.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/dist/css/bootstrap.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)