]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
tooltip.js: reuse existent variable
authorXhmikosR <xhmikosr@gmail.com>
Wed, 25 Nov 2020 07:45:36 +0000 (09:45 +0200)
committerXhmikosR <xhmikosr@gmail.com>
Mon, 30 Nov 2020 10:07:51 +0000 (12:07 +0200)
js/src/tooltip.js

index a04739b7fe7c42c8ce825d2b0ff01d6f0c9c93ec..62b33883988c5c0282fbc35a09450ae3e735fe11 100644 (file)
@@ -584,8 +584,8 @@ class Tooltip extends BaseComponent {
 
     if (title || originalTitleType !== 'string') {
       this._element.setAttribute('data-bs-original-title', title || '')
-      if (this._element.getAttribute('title') && !this._element.getAttribute('aria-label') && !this._element.textContent) {
-        this._element.setAttribute('aria-label', this._element.getAttribute('title'))
+      if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) {
+        this._element.setAttribute('aria-label', title)
       }
 
       this._element.setAttribute('title', '')