aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/js/src/popover.js
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-07-29 08:25:05 +0000
committerMario <mario@mariovavti.com>2021-07-29 08:25:05 +0000
commitd459dfac74e90c29950d49a82edc19fd913d435e (patch)
tree7bed5f2dbc318f87bbe0f4be2cde3dde09cd97c7 /vendor/twbs/bootstrap/js/src/popover.js
parentcec2f0d894b80f3affeb60cff2d4afa49a2019a8 (diff)
downloadvolse-hubzilla-d459dfac74e90c29950d49a82edc19fd913d435e.tar.gz
volse-hubzilla-d459dfac74e90c29950d49a82edc19fd913d435e.tar.bz2
volse-hubzilla-d459dfac74e90c29950d49a82edc19fd913d435e.zip
update to bootstrap 5.0.2
Diffstat (limited to 'vendor/twbs/bootstrap/js/src/popover.js')
-rw-r--r--vendor/twbs/bootstrap/js/src/popover.js35
1 files changed, 21 insertions, 14 deletions
diff --git a/vendor/twbs/bootstrap/js/src/popover.js b/vendor/twbs/bootstrap/js/src/popover.js
index b39985124..5a3b32631 100644
--- a/vendor/twbs/bootstrap/js/src/popover.js
+++ b/vendor/twbs/bootstrap/js/src/popover.js
@@ -1,12 +1,11 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.0.1): popover.js
+ * Bootstrap (v5.0.2): popover.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
import { defineJQueryPlugin } from './util/index'
-import Data from './dom/data'
import SelectorEngine from './dom/selector-engine'
import Tooltip from './tooltip'
@@ -30,7 +29,7 @@ const Default = {
content: '',
template: '<div class="popover" role="tooltip">' +
'<div class="popover-arrow"></div>' +
- '<h3 class="popover-header"></h3>' +
+ '<h3 class="popover-header"></h3>' +
'<div class="popover-body"></div>' +
'</div>'
}
@@ -90,6 +89,24 @@ class Popover extends Tooltip {
return this.getTitle() || this._getContent()
}
+ getTipElement() {
+ if (this.tip) {
+ return this.tip
+ }
+
+ this.tip = super.getTipElement()
+
+ if (!this.getTitle()) {
+ SelectorEngine.findOne(SELECTOR_TITLE, this.tip).remove()
+ }
+
+ if (!this._getContent()) {
+ SelectorEngine.findOne(SELECTOR_CONTENT, this.tip).remove()
+ }
+
+ return this.tip
+ }
+
setContent() {
const tip = this.getTipElement()
@@ -128,17 +145,7 @@ class Popover extends Tooltip {
static jQueryInterface(config) {
return this.each(function () {
- let data = Data.get(this, DATA_KEY)
- const _config = typeof config === 'object' ? config : null
-
- if (!data && /dispose|hide/.test(config)) {
- return
- }
-
- if (!data) {
- data = new Popover(this, _config)
- Data.set(this, DATA_KEY, data)
- }
+ const data = Popover.getOrCreateInstance(this, config)
if (typeof config === 'string') {
if (typeof data[config] === 'undefined') {