mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-27 05:49:07 +02:00
use a class private getter to decouple same methods usage
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user