mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-02 16:04:07 +03:00
Add throw error for undefined method on plugins
This commit is contained in:
+3
-1
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user