1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-09 15:16:51 +02:00
This commit is contained in:
Mark Otto
2017-04-21 23:58:09 -07:00
parent 638b97f19c
commit ba312c20a5
28 changed files with 155 additions and 47 deletions

16
js/dist/tooltip.js vendored
View File

@@ -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