diff options
| author | XhmikosR <[email protected]> | 2021-09-09 15:01:58 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-09-09 15:01:58 +0300 |
| commit | e961454738f4033eb2be68bde4b257ea9e0a7765 (patch) | |
| tree | 507ca252e706a9c692b133b6e18fb8504c488837 /js/dist/tooltip.js | |
| parent | 86d5d5ea79e8eaa15a28b9da92bbee53036640f6 (diff) | |
| parent | 1df098361cac04217d6a464c80e890c4335ecb5c (diff) | |
| download | bootstrap-main-xmr-docs-render-heading.tar.xz bootstrap-main-xmr-docs-render-heading.zip | |
Merge branch 'main' into main-xmr-docs-render-headingmain-xmr-docs-render-heading
Diffstat (limited to 'js/dist/tooltip.js')
| -rw-r--r-- | js/dist/tooltip.js | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/js/dist/tooltip.js b/js/dist/tooltip.js index 4bcf1860b..9f8380086 100644 --- a/js/dist/tooltip.js +++ b/js/dist/tooltip.js @@ -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 |
