1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-10 07:37:27 +02:00
This commit is contained in:
Mark Otto
2017-03-28 09:31:32 -07:00
parent 296c99020c
commit cf7d3e11e0
16 changed files with 75 additions and 37 deletions

10
js/dist/tooltip.js vendored
View File

@@ -34,6 +34,7 @@ var Tooltip = function ($) {
var JQUERY_NO_CONFLICT = $.fn[NAME];
var TRANSITION_DURATION = 150;
var CLASS_PREFIX = 'bs-tether';
var TETHER_PREFIX_REGEX = new RegExp('(^|\\s)' + CLASS_PREFIX + '\\S+', 'g');
var Default = {
animation: true,
@@ -298,6 +299,7 @@ var Tooltip = function ($) {
tip.parentNode.removeChild(tip);
}
_this2._cleanTipClass();
_this2.element.removeAttribute('aria-describedby');
$(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
_this2._isTransitioning = false;
@@ -388,6 +390,14 @@ var Tooltip = function ($) {
return AttachmentMap[placement.toUpperCase()];
};
Tooltip.prototype._cleanTipClass = function _cleanTipClass() {
var $tip = $(this.getTipElement());
var tabClass = $tip.attr('class').match(TETHER_PREFIX_REGEX);
if (tabClass !== null && tabClass.length > 0) {
$tip.removeClass(tabClass.join(''));
}
};
Tooltip.prototype._setListeners = function _setListeners() {
var _this3 = this;