From cf7d3e11e0ca33d01246706899b77a1f4fc14733 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Tue, 28 Mar 2017 09:31:32 -0700 Subject: grunt --- js/dist/tooltip.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'js/dist/tooltip.js') diff --git a/js/dist/tooltip.js b/js/dist/tooltip.js index a7a9f4226..024c3f05c 100644 --- a/js/dist/tooltip.js +++ b/js/dist/tooltip.js @@ -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; -- cgit v1.2.3 From 49b6cf845d3d3bf49197a529548489f9a1a76709 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 1 Apr 2017 19:18:29 -0700 Subject: grunt --- js/dist/tooltip.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'js/dist/tooltip.js') diff --git a/js/dist/tooltip.js b/js/dist/tooltip.js index 024c3f05c..018ed4aa3 100644 --- a/js/dist/tooltip.js +++ b/js/dist/tooltip.js @@ -126,7 +126,6 @@ var Tooltip = function ($) { this._timeout = 0; this._hoverState = ''; this._activeTrigger = {}; - this._isTransitioning = false; this._tether = null; // protected @@ -215,9 +214,6 @@ var Tooltip = function ($) { var showEvent = $.Event(this.constructor.Event.SHOW); if (this.isWithContent() && this._isEnabled) { - if (this._isTransitioning) { - throw new Error('Tooltip is transitioning'); - } $(this.element).trigger(showEvent); var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element); @@ -244,7 +240,11 @@ var Tooltip = function ($) { var container = this.config.container === false ? document.body : $(this.config.container); - $(tip).data(this.constructor.DATA_KEY, this).appendTo(container); + $(tip).data(this.constructor.DATA_KEY, this); + + if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) { + $(tip).appendTo(container); + } $(this.element).trigger(this.constructor.Event.INSERTED); @@ -267,7 +267,6 @@ var Tooltip = function ($) { var complete = function complete() { var prevHoverState = _this._hoverState; _this._hoverState = null; - _this._isTransitioning = false; $(_this.element).trigger(_this.constructor.Event.SHOWN); @@ -277,7 +276,6 @@ var Tooltip = function ($) { }; if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) { - this._isTransitioning = true; $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION); return; } @@ -291,9 +289,6 @@ var Tooltip = function ($) { var tip = this.getTipElement(); var hideEvent = $.Event(this.constructor.Event.HIDE); - if (this._isTransitioning) { - throw new Error('Tooltip is transitioning'); - } var complete = function complete() { if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) { tip.parentNode.removeChild(tip); @@ -302,7 +297,6 @@ var Tooltip = function ($) { _this2._cleanTipClass(); _this2.element.removeAttribute('aria-describedby'); $(_this2.element).trigger(_this2.constructor.Event.HIDDEN); - _this2._isTransitioning = false; _this2.cleanupTether(); if (callback) { @@ -323,7 +317,7 @@ var Tooltip = function ($) { this._activeTrigger[Trigger.HOVER] = false; if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) { - this._isTransitioning = true; + $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); } else { complete(); @@ -531,6 +525,14 @@ var Tooltip = function ($) { }; } + if (config.title && typeof config.title === 'number') { + config.title = config.title.toString(); + } + + if (config.content && typeof config.content === 'number') { + config.content = config.content.toString(); + } + Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); return config; -- cgit v1.2.3