diff options
| author | GeoSot <[email protected]> | 2021-11-25 20:33:42 +0200 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2021-12-01 18:00:36 +0200 |
| commit | 53c77c020368dbd570bd2d29ffc0c3660a0f6ab3 (patch) | |
| tree | 517b786ab0dd4939568a38c7982e52c58b2a112f /js/src/tooltip.js | |
| parent | a5945369bdcaccb5d80589b9e9b0fab67e8a4e9c (diff) | |
| download | bootstrap-53c77c020368dbd570bd2d29ffc0c3660a0f6ab3.tar.xz bootstrap-53c77c020368dbd570bd2d29ffc0c3660a0f6ab3.zip | |
Tooltip: refactor jQueryInterface
Diffstat (limited to 'js/src/tooltip.js')
| -rw-r--r-- | js/src/tooltip.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/js/src/tooltip.js b/js/src/tooltip.js index b09ab0d0c..b0963a002 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -637,13 +637,15 @@ class Tooltip extends BaseComponent { return this.each(function () { const data = Tooltip.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]() }) } } |
