Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'js/dist/tooltip.js')
-rw-r--r--js/dist/tooltip.js35
1 files changed, 23 insertions, 12 deletions
diff --git a/js/dist/tooltip.js b/js/dist/tooltip.js
index 4bcf1860b0..9f83800864 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