mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-23 09:41:11 +00:00
tooltip.js: deduplicate _fixTitle()
(#32124)
This commit is contained in:
parent
44fef1677b
commit
470e99ed5f
@ -578,14 +578,11 @@ class Tooltip {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_fixTitle() {
|
_fixTitle() {
|
||||||
const titleType = typeof this.element.getAttribute('data-bs-original-title')
|
const title = this.element.getAttribute('title')
|
||||||
|
const originalTitleType = 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') || ''
|
|
||||||
)
|
|
||||||
|
|
||||||
|
if (title || originalTitleType !== 'string') {
|
||||||
|
this.element.setAttribute('data-bs-original-title', title || '')
|
||||||
this.element.setAttribute('title', '')
|
this.element.setAttribute('title', '')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user