mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-25 04:12:55 +01:00
popover: Move common code in tooltip's getTipElement()
This commit is contained in:
parent
a97fd1cd24
commit
9c3ceaa25b
@ -51,9 +51,6 @@ const Event = {
|
|||||||
MOUSELEAVE: `mouseleave${EVENT_KEY}`
|
MOUSELEAVE: `mouseleave${EVENT_KEY}`
|
||||||
}
|
}
|
||||||
|
|
||||||
const CLASS_NAME_FADE = 'fade'
|
|
||||||
const CLASS_NAME_SHOW = 'show'
|
|
||||||
|
|
||||||
const SELECTOR_TITLE = '.popover-header'
|
const SELECTOR_TITLE = '.popover-header'
|
||||||
const SELECTOR_CONTENT = '.popover-body'
|
const SELECTOR_CONTENT = '.popover-body'
|
||||||
|
|
||||||
@ -117,8 +114,6 @@ class Popover extends Tooltip {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content)
|
this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content)
|
||||||
|
|
||||||
tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Private
|
// Private
|
||||||
|
@ -367,7 +367,10 @@ class Tooltip extends BaseComponent {
|
|||||||
const element = document.createElement('div')
|
const element = document.createElement('div')
|
||||||
element.innerHTML = this._config.template
|
element.innerHTML = this._config.template
|
||||||
|
|
||||||
this.tip = element.children[0]
|
const tip = element.children[0]
|
||||||
|
tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)
|
||||||
|
|
||||||
|
this.tip = tip
|
||||||
return this.tip
|
return this.tip
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user