1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-26 06:44:35 +02:00

Add throw error for undefined method on plugins

This commit is contained in:
Johann-S
2015-09-16 10:35:29 +02:00
parent c34fdd415e
commit 21a65f181e
16 changed files with 121 additions and 4 deletions

View File

@@ -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)
}