Skip to content

Commit

Permalink
popover: Move common code in tooltip's getTipElement()
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoSot authored and XhmikosR committed Jul 22, 2021
1 parent c5f8439 commit fa562be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 0 additions & 5 deletions js/src/popover.js
Expand Up @@ -51,9 +51,6 @@ const Event = {
MOUSELEAVE: `mouseleave${EVENT_KEY}`
}

const CLASS_NAME_FADE = 'fade'
const CLASS_NAME_SHOW = 'show'

const SELECTOR_TITLE = '.popover-header'
const SELECTOR_CONTENT = '.popover-body'

Expand Down Expand Up @@ -117,8 +114,6 @@ class Popover extends Tooltip {
}

this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content)

tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)
}

// Private
Expand Down
5 changes: 4 additions & 1 deletion js/src/tooltip.js
Expand Up @@ -367,7 +367,10 @@ class Tooltip extends BaseComponent {
const element = document.createElement('div')
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
}

Expand Down

0 comments on commit fa562be

Please sign in to comment.