aboutsummaryrefslogtreecommitdiff
path: root/js/src/popover.js
diff options
context:
space:
mode:
authorGeoSot <[email protected]>2021-06-10 10:48:35 +0300
committerXhmikosR <[email protected]>2021-07-22 17:20:38 +0300
commitc4e189df40ffced65848d440e8e95892360445ba (patch)
treeaf7c73303561d4e530cc54d7daf0932351e2045e /js/src/popover.js
parent75b293459628d976f26347c64774b909be329336 (diff)
downloadbootstrap-c4e189df40ffced65848d440e8e95892360445ba.tar.xz
bootstrap-c4e189df40ffced65848d440e8e95892360445ba.zip
use a class private getter to decouple same methods usage
Diffstat (limited to 'js/src/popover.js')
-rw-r--r--js/src/popover.js14
1 files changed, 2 insertions, 12 deletions
diff --git a/js/src/popover.js b/js/src/popover.js
index 5a3b32631..a08e4c4dd 100644
--- a/js/src/popover.js
+++ b/js/src/popover.js
@@ -19,7 +19,6 @@ const NAME = 'popover'
const DATA_KEY = 'bs.popover'
const EVENT_KEY = `.${DATA_KEY}`
const CLASS_PREFIX = 'bs-popover'
-const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g')
const Default = {
...Tooltip.Default,
@@ -124,21 +123,12 @@ class Popover extends Tooltip {
// Private
- _addAttachmentClass(attachment) {
- this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`)
- }
-
_getContent() {
return this._element.getAttribute('data-bs-content') || this._config.content
}
- _cleanTipClass() {
- const tip = this.getTipElement()
- const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX)
- if (tabClass !== null && tabClass.length > 0) {
- tabClass.map(token => token.trim())
- .forEach(tClass => tip.classList.remove(tClass))
- }
+ _getBasicClassPrefix() {
+ return CLASS_PREFIX
}
// Static