mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-08 22:56:46 +02:00
35
js/dist/tooltip.js
vendored
35
js/dist/tooltip.js
vendored
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap tooltip.js v5.1.0 (https://getbootstrap.com/)
|
||||
* Bootstrap tooltip.js v5.1.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): util/index.js
|
||||
* Bootstrap (v5.1.1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -182,7 +182,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): util/sanitizer.js
|
||||
* Bootstrap (v5.1.1): util/sanitizer.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -295,7 +295,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.0): tooltip.js
|
||||
* Bootstrap (v5.1.1): tooltip.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -469,9 +469,7 @@
|
||||
this.tip.remove();
|
||||
}
|
||||
|
||||
if (this._popper) {
|
||||
this._popper.destroy();
|
||||
}
|
||||
this._disposePopper();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
@@ -491,6 +489,15 @@
|
||||
|
||||
if (showEvent.defaultPrevented || !isInTheDom) {
|
||||
return;
|
||||
} // A trick to recreate a tooltip in case a new title is given by using the NOT documented `data-bs-original-title`
|
||||
// This will be removed later in favor of a `setContent` method
|
||||
|
||||
|
||||
if (this.constructor.NAME === 'tooltip' && this.tip && this.getTitle() !== this.tip.querySelector(SELECTOR_TOOLTIP_INNER).innerHTML) {
|
||||
this._disposePopper();
|
||||
|
||||
this.tip.remove();
|
||||
this.tip = null;
|
||||
}
|
||||
|
||||
const tip = this.getTipElement();
|
||||
@@ -580,11 +587,7 @@
|
||||
|
||||
EventHandler__default['default'].trigger(this._element, this.constructor.Event.HIDDEN);
|
||||
|
||||
if (this._popper) {
|
||||
this._popper.destroy();
|
||||
|
||||
this._popper = null;
|
||||
}
|
||||
this._disposePopper();
|
||||
};
|
||||
|
||||
const hideEvent = EventHandler__default['default'].trigger(this._element, this.constructor.Event.HIDE);
|
||||
@@ -964,6 +967,14 @@
|
||||
this._cleanTipClass();
|
||||
|
||||
this._addAttachmentClass(this._getAttachment(state.placement));
|
||||
}
|
||||
|
||||
_disposePopper() {
|
||||
if (this._popper) {
|
||||
this._popper.destroy();
|
||||
|
||||
this._popper = null;
|
||||
}
|
||||
} // Static
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user