aboutsummaryrefslogtreecommitdiff
path: root/js/src/modal.js
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2015-09-16 10:35:29 +0200
committerJohann-S <[email protected]>2015-10-02 10:01:24 +0200
commit21a65f181eebc3f2c0cd43fb3383ee3de673745b (patch)
tree72a1c5e6da10a3dd7c918e05d0eff6a4d8e0c0aa /js/src/modal.js
parentc34fdd415e864e5e6a64f36a0278b5d43c15d3a2 (diff)
downloadbootstrap-21a65f181eebc3f2c0cd43fb3383ee3de673745b.tar.xz
bootstrap-21a65f181eebc3f2c0cd43fb3383ee3de673745b.zip
Add throw error for undefined method on plugins
Diffstat (limited to 'js/src/modal.js')
-rw-r--r--js/src/modal.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/js/src/modal.js b/js/src/modal.js
index f57131e7e..99a49f148 100644
--- a/js/src/modal.js
+++ b/js/src/modal.js
@@ -463,8 +463,10 @@ const Modal = (($) => {
}
if (typeof config === 'string') {
+ if (data[config] === undefined) {
+ throw new Error(`No method named "${config}"`)
+ }
data[config](relatedTarget)
-
} else if (_config.show) {
data.show(relatedTarget)
}