aboutsummaryrefslogtreecommitdiff
path: root/js/src/tooltip.js
diff options
context:
space:
mode:
authorGijs Boddeus <[email protected]>2017-08-25 23:29:40 +0200
committerGitHub <[email protected]>2017-08-25 23:29:40 +0200
commit4356d08abb4d94785af15f3cc9be0e553f1c1c03 (patch)
treece649fd410b7e9a38758ef8318e1d9aba5eef3e8 /js/src/tooltip.js
parenta103958975787653b4ba84f80d1d1e8f7be302c3 (diff)
parentba6a6f13691000ffaf22ef8e731513737659447f (diff)
downloadbootstrap-4356d08abb4d94785af15f3cc9be0e553f1c1c03.tar.xz
bootstrap-4356d08abb4d94785af15f3cc9be0e553f1c1c03.zip
Merge pull request #3 from twbs/v4-dev
update from official repo
Diffstat (limited to 'js/src/tooltip.js')
-rw-r--r--js/src/tooltip.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/js/src/tooltip.js b/js/src/tooltip.js
index 2060cebbb..37573cf49 100644
--- a/js/src/tooltip.js
+++ b/js/src/tooltip.js
@@ -184,6 +184,10 @@ const Tooltip = (($) => {
}
toggle(event) {
+ if (!this._isEnabled) {
+ return
+ }
+
if (event) {
const dataKey = this.constructor.DATA_KEY
let context = $(event.currentTarget).data(dataKey)
@@ -234,8 +238,8 @@ const Tooltip = (($) => {
if (this._popper !== null) {
this._popper.destroy()
}
- this._popper = null
+ this._popper = null
this.element = null
this.config = null
this.tip = null
@@ -415,7 +419,8 @@ const Tooltip = (($) => {
}
getTipElement() {
- return this.tip = this.tip || $(this.config.template)[0]
+ this.tip = this.tip || $(this.config.template)[0]
+ return this.tip
}
setContent() {
@@ -698,14 +703,13 @@ const Tooltip = (($) => {
}
if (typeof config === 'string') {
- if (data[config] === undefined) {
+ if (typeof data[config] === 'undefined') {
throw new Error(`No method named "${config}"`)
}
data[config]()
}
})
}
-
}