From: XhmikosR Date: Sat, 14 Nov 2020 13:43:25 +0000 (+0200) Subject: tooltip.js: deduplicate `_fixTitle()` (#32124) X-Git-Tag: v5.0.0-beta1~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=470e99ed5f53f8a94df9e501fcc30423151be324;p=thirdparty%2Fbootstrap.git tooltip.js: deduplicate `_fixTitle()` (#32124) --- 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', '') } }