Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <markdotto@gmail.com>2017-04-22 09:58:09 +0300
committerMark Otto <markdotto@gmail.com>2017-04-22 09:58:09 +0300
commitba312c20a5ceca42117dd53303bafda485d8facd (patch)
tree2d185875a0ac2b73d34a8187e7d4c696b7625eec /js/dist/tooltip.js
parent638b97f19c4df6f51475f8088555e3eefd2b986f (diff)
build
Diffstat (limited to 'js/dist/tooltip.js')
-rw-r--r--js/dist/tooltip.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/js/dist/tooltip.js b/js/dist/tooltip.js
index 018ed4aa3d..af385927ff 100644
--- a/js/dist/tooltip.js
+++ b/js/dist/tooltip.js
@@ -264,6 +264,14 @@ var Tooltip = function ($) {
$(tip).addClass(ClassName.SHOW);
+ // if this is a touch-enabled device we add extra
+ // empty mouseover listeners to the body's immediate children;
+ // only needed because of broken event delegation on iOS
+ // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
+ if ('ontouchstart' in document.documentElement) {
+ $('body').children().on('mouseover', null, $.noop);
+ }
+
var complete = function complete() {
var prevHoverState = _this._hoverState;
_this._hoverState = null;
@@ -312,6 +320,12 @@ var Tooltip = function ($) {
$(tip).removeClass(ClassName.SHOW);
+ // if this is a touch-enabled device we remove the extra
+ // empty mouseover listeners we added for iOS support
+ if ('ontouchstart' in document.documentElement) {
+ $('body').children().off('mouseover', null, $.noop);
+ }
+
this._activeTrigger[Trigger.CLICK] = false;
this._activeTrigger[Trigger.FOCUS] = false;
this._activeTrigger[Trigger.HOVER] = false;
@@ -632,4 +646,4 @@ var Tooltip = function ($) {
return Tooltip;
}(jQuery); /* global Tether */
-//# sourceMappingURL=tooltip.js.map
+//# sourceMappingURL=tooltip.js.map \ No newline at end of file