mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-26 21:39:08 +02:00
Add throw error for undefined method on plugins
This commit is contained in:
@@ -390,10 +390,11 @@ const Carousel = (($) => {
|
||||
|
||||
if (typeof config === 'number') {
|
||||
data.to(config)
|
||||
|
||||
} else if (action) {
|
||||
} else if (typeof action === 'string') {
|
||||
if (data[action] === undefined) {
|
||||
throw new Error(`No method named "${action}"`)
|
||||
}
|
||||
data[action]()
|
||||
|
||||
} else if (_config.interval) {
|
||||
data.pause()
|
||||
data.cycle()
|
||||
|
Reference in New Issue
Block a user