diff options
| author | XhmikosR <[email protected]> | 2021-06-22 21:29:16 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-06-22 21:29:16 +0300 |
| commit | 688bce4fa695cc360a0d084e34f029b0c192b223 (patch) | |
| tree | dcda8a139b0225f23df2c3d3811afdefbc6d5af0 /js/dist/tooltip.js | |
| parent | 16d5041a76748580bae47ce168ba579daae9725b (diff) | |
| download | bootstrap-5.0.2.tar.xz bootstrap-5.0.2.zip | |
Release v5.0.2 (#34276)v5.0.2
* Bump version to v5.0.2.
* Dist
Diffstat (limited to 'js/dist/tooltip.js')
| -rw-r--r-- | js/dist/tooltip.js | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/js/dist/tooltip.js b/js/dist/tooltip.js index 91a235d86..5a4ac0208 100644 --- a/js/dist/tooltip.js +++ b/js/dist/tooltip.js @@ -1,5 +1,5 @@ /*! - * Bootstrap tooltip.js v5.0.1 (https://getbootstrap.com/) + * Bootstrap tooltip.js v5.0.2 (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.0.1): util/index.js + * Bootstrap (v5.0.2): util/index.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ @@ -143,9 +143,18 @@ return null; }; + const DOMContentLoadedCallbacks = []; + const onDOMContentLoaded = callback => { if (document.readyState === 'loading') { - document.addEventListener('DOMContentLoaded', callback); + // add listener on the first call when the document is in loading state + if (!DOMContentLoadedCallbacks.length) { + document.addEventListener('DOMContentLoaded', () => { + DOMContentLoadedCallbacks.forEach(callback => callback()); + }); + } + + DOMContentLoadedCallbacks.push(callback); } else { callback(); } @@ -174,7 +183,7 @@ /** * -------------------------------------------------------------------------- - * Bootstrap (v5.0.1): util/sanitizer.js + * Bootstrap (v5.0.2): util/sanitizer.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ @@ -269,7 +278,7 @@ const elName = el.nodeName.toLowerCase(); if (!allowlistKeys.includes(elName)) { - el.parentNode.removeChild(el); + el.remove(); continue; } @@ -287,7 +296,7 @@ /** * -------------------------------------------------------------------------- - * Bootstrap (v5.0.1): tooltip.js + * Bootstrap (v5.0.2): tooltip.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ @@ -456,8 +465,8 @@ clearTimeout(this._timeout); EventHandler__default['default'].off(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler); - if (this.tip && this.tip.parentNode) { - this.tip.parentNode.removeChild(this.tip); + if (this.tip) { + this.tip.remove(); } if (this._popper) { @@ -562,8 +571,8 @@ return; } - if (this._hoverState !== HOVER_STATE_SHOW && tip.parentNode) { - tip.parentNode.removeChild(tip); + if (this._hoverState !== HOVER_STATE_SHOW) { + tip.remove(); } this._cleanTipClass(); @@ -950,17 +959,7 @@ static jQueryInterface(config) { return this.each(function () { - let data = Data__default['default'].get(this, DATA_KEY); - - const _config = typeof config === 'object' && config; - - if (!data && /dispose|hide/.test(config)) { - return; - } - - if (!data) { - data = new Tooltip(this, _config); - } + const data = Tooltip.getOrCreateInstance(this, config); if (typeof config === 'string') { if (typeof data[config] === 'undefined') { |
