Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoSot <geo.sotis@gmail.com>2021-11-25 21:33:42 +0300
committerXhmikosR <xhmikosr@gmail.com>2021-12-01 19:00:36 +0300
commit53c77c020368dbd570bd2d29ffc0c3660a0f6ab3 (patch)
tree517b786ab0dd4939568a38c7982e52c58b2a112f /js/src/popover.js
parenta5945369bdcaccb5d80589b9e9b0fab67e8a4e9c (diff)
Tooltip: refactor jQueryInterface
Diffstat (limited to 'js/src/popover.js')
-rw-r--r--js/src/popover.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/js/src/popover.js b/js/src/popover.js
index 19c1e42a4d..aea1b97020 100644
--- a/js/src/popover.js
+++ b/js/src/popover.js
@@ -94,13 +94,15 @@ class Popover extends Tooltip {
return this.each(function () {
const data = Popover.getOrCreateInstance(this, config)
- if (typeof config === 'string') {
- if (typeof data[config] === 'undefined') {
- throw new TypeError(`No method named "${config}"`)
- }
+ if (typeof config !== 'string') {
+ return
+ }
- data[config]()
+ if (typeof data[config] === 'undefined') {
+ throw new TypeError(`No method named "${config}"`)
}
+
+ data[config]()
})
}
}