1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-08 14:46:34 +02:00

Making .tooltip('show') throw an error on elements with display:none (#20940)

This commit is contained in:
Johann
2016-11-01 04:33:53 +01:00
committed by Mark Otto
parent 0974267b8c
commit a7f1b59959
3 changed files with 28 additions and 0 deletions

View File

@@ -239,6 +239,9 @@ const Tooltip = (($) => {
}
show() {
if ($(this.element).css('display') === 'none') {
throw new Error('Please use show on visible elements')
}
let showEvent = $.Event(this.constructor.Event.SHOW)
if (this.isWithContent() && this._isEnabled) {