aboutsummaryrefslogtreecommitdiff
path: root/js/src/popover.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/popover.js')
-rw-r--r--js/src/popover.js36
1 files changed, 11 insertions, 25 deletions
diff --git a/js/src/popover.js b/js/src/popover.js
index d499bedf1..19c1e42a4 100644
--- a/js/src/popover.js
+++ b/js/src/popover.js
@@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.1.2): popover.js
+ * Bootstrap (v5.1.3): popover.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -9,15 +9,15 @@ import { defineJQueryPlugin } from './util/index'
import Tooltip from './tooltip'
/**
- * ------------------------------------------------------------------------
* Constants
- * ------------------------------------------------------------------------
*/
const NAME = 'popover'
const DATA_KEY = 'bs.popover'
const EVENT_KEY = `.${DATA_KEY}`
-const CLASS_PREFIX = 'bs-popover'
+
+const SELECTOR_TITLE = '.popover-header'
+const SELECTOR_CONTENT = '.popover-body'
const Default = {
...Tooltip.Default,
@@ -50,18 +50,12 @@ const Event = {
MOUSELEAVE: `mouseleave${EVENT_KEY}`
}
-const SELECTOR_TITLE = '.popover-header'
-const SELECTOR_CONTENT = '.popover-body'
-
/**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
+ * Class definition
*/
class Popover extends Tooltip {
// Getters
-
static get Default() {
return Default
}
@@ -79,28 +73,23 @@ class Popover extends Tooltip {
}
// Overrides
-
isWithContent() {
return this.getTitle() || this._getContent()
}
- setContent(tip) {
- this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TITLE)
- this._sanitizeAndSetContent(tip, this._getContent(), SELECTOR_CONTENT)
- }
-
// Private
+ _getContentForTemplate() {
+ return {
+ [SELECTOR_TITLE]: this.getTitle(),
+ [SELECTOR_CONTENT]: this._getContent()
+ }
+ }
_getContent() {
return this._resolvePossibleFunction(this._config.content)
}
- _getBasicClassPrefix() {
- return CLASS_PREFIX
- }
-
// Static
-
static jQueryInterface(config) {
return this.each(function () {
const data = Popover.getOrCreateInstance(this, config)
@@ -117,10 +106,7 @@ class Popover extends Tooltip {
}
/**
- * ------------------------------------------------------------------------
* jQuery
- * ------------------------------------------------------------------------
- * add .Popover to jQuery only if jQuery is present
*/
defineJQueryPlugin(Popover)