diff options
author | XhmikosR <xhmikosr@gmail.com> | 2020-11-14 16:43:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-14 16:43:25 +0300 |
commit | 470e99ed5f53f8a94df9e501fcc30423151be324 (patch) | |
tree | d8c9d1113918357e2640c3dab0a68300b635acd8 /js/src/tooltip.js | |
parent | 44fef1677b0ad9599040b56125ccd58c41c3fdd8 (diff) |
tooltip.js: deduplicate `_fixTitle()` (#32124)
Diffstat (limited to 'js/src/tooltip.js')
-rw-r--r-- | js/src/tooltip.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 505f8c8532..2a55992cba 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -578,14 +578,11 @@ class Tooltip { } _fixTitle() { - const titleType = typeof this.element.getAttribute('data-bs-original-title') - - if (this.element.getAttribute('title') || titleType !== 'string') { - this.element.setAttribute( - 'data-bs-original-title', - this.element.getAttribute('title') || '' - ) + const title = this.element.getAttribute('title') + const originalTitleType = typeof this.element.getAttribute('data-bs-original-title') + if (title || originalTitleType !== 'string') { + this.element.setAttribute('data-bs-original-title', title || '') this.element.setAttribute('title', '') } } |