diff options
Diffstat (limited to 'js/src/tab.js')
| -rw-r--r-- | js/src/tab.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/js/src/tab.js b/js/src/tab.js index 4b311c24e..393a92b44 100644 --- a/js/src/tab.js +++ b/js/src/tab.js @@ -3,7 +3,7 @@ import Util from './util' /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0): tab.js + * Bootstrap (v4.0.0-alpha): tab.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -18,7 +18,7 @@ const Tab = (($) => { */ const NAME = 'tab' - const VERSION = '4.0.0' + const VERSION = '4.0.0-alpha' const DATA_KEY = 'bs.tab' const EVENT_KEY = `.${DATA_KEY}` const DATA_API_KEY = '.data-api' @@ -234,6 +234,9 @@ const Tab = (($) => { } if (typeof config === 'string') { + if (data[config] === undefined) { + throw new Error(`No method named "${config}"`) + } data[config]() } }) @@ -250,9 +253,9 @@ const Tab = (($) => { $(document) .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { - event.preventDefault() - Tab._jQueryInterface.call($(this), 'show') - }) + event.preventDefault() + Tab._jQueryInterface.call($(this), 'show') + }) /** |
