aboutsummaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorGeoSot <[email protected]>2021-11-29 16:25:12 +0200
committerXhmikosR <[email protected]>2021-12-01 18:00:36 +0200
commit385fea49e8a7c83f2e9655cd9453256aef254aaa (patch)
treeb0aa855613a8bdffd70e0a03a2a4593394e02bf9 /js/src
parentbd79d69a73a77172584baadf9aa36e2d2091160e (diff)
downloadbootstrap-385fea49e8a7c83f2e9655cd9453256aef254aaa.tar.xz
bootstrap-385fea49e8a7c83f2e9655cd9453256aef254aaa.zip
Tooltip/Popover: add underscore prefix to protected functions
Diffstat (limited to 'js/src')
-rw-r--r--js/src/popover.js6
-rw-r--r--js/src/tooltip.js20
2 files changed, 13 insertions, 13 deletions
diff --git a/js/src/popover.js b/js/src/popover.js
index aea1b9702..77f847110 100644
--- a/js/src/popover.js
+++ b/js/src/popover.js
@@ -73,14 +73,14 @@ class Popover extends Tooltip {
}
// Overrides
- isWithContent() {
- return this.getTitle() || this._getContent()
+ _isWithContent() {
+ return this._getTitle() || this._getContent()
}
// Private
_getContentForTemplate() {
return {
- [SELECTOR_TITLE]: this.getTitle(),
+ [SELECTOR_TITLE]: this._getTitle(),
[SELECTOR_CONTENT]: this._getContent()
}
}
diff --git a/js/src/tooltip.js b/js/src/tooltip.js
index 5fd1927c9..2f3acda38 100644
--- a/js/src/tooltip.js
+++ b/js/src/tooltip.js
@@ -181,7 +181,7 @@ class Tooltip extends BaseComponent {
context._leave()
}
} else {
- if (this.getTipElement().classList.contains(CLASS_NAME_SHOW)) {
+ if (this._getTipElement().classList.contains(CLASS_NAME_SHOW)) {
this._leave()
return
}
@@ -208,7 +208,7 @@ class Tooltip extends BaseComponent {
throw new Error('Please use show on visible elements')
}
- if (!(this.isWithContent() && this._isEnabled)) {
+ if (!(this._isWithContent() && this._isEnabled)) {
return
}
@@ -222,7 +222,7 @@ class Tooltip extends BaseComponent {
return
}
- const tip = this.getTipElement()
+ const tip = this._getTipElement()
this._element.setAttribute('aria-describedby', tip.getAttribute('id'))
@@ -279,7 +279,7 @@ class Tooltip extends BaseComponent {
return
}
- const tip = this.getTipElement()
+ const tip = this._getTipElement()
tip.classList.remove(CLASS_NAME_SHOW)
// If this is a touch-enabled device we remove the extra
@@ -320,11 +320,11 @@ class Tooltip extends BaseComponent {
}
// Protected
- isWithContent() {
- return Boolean(this.getTitle())
+ _isWithContent() {
+ return Boolean(this._getTitle())
}
- getTipElement() {
+ _getTipElement() {
if (!this.tip) {
this.tip = this._createTipElement(this._getContentForTemplate())
}
@@ -389,11 +389,11 @@ class Tooltip extends BaseComponent {
_getContentForTemplate() {
return {
- [SELECTOR_TOOLTIP_INNER]: this.getTitle()
+ [SELECTOR_TOOLTIP_INNER]: this._getTitle()
}
}
- getTitle() {
+ _getTitle() {
return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('title')
}
@@ -518,7 +518,7 @@ class Tooltip extends BaseComponent {
}
_enter() {
- if (this.getTipElement().classList.contains(CLASS_NAME_SHOW) || this._isHovered) {
+ if (this._getTipElement().classList.contains(CLASS_NAME_SHOW) || this._isHovered) {
this._isHovered = true
return
}