aboutsummaryrefslogtreecommitdiff
path: root/js/src/tab.js
diff options
context:
space:
mode:
authorAlexandr Kondrashov <[email protected]>2015-12-08 02:18:32 +0300
committerAlexandr Kondrashov <[email protected]>2015-12-08 02:18:32 +0300
commit5f316e6dc34f57bfbd0ebf922fe5a01cc6bb38c4 (patch)
tree2951782d8d0aadb61dae9122d0f508a75ed8e7eb /js/src/tab.js
parentc9725926b2f30bed4e37f57c20ef8ffeb2fd233b (diff)
parentafbaf4350560eaf2135fb0dc6dd761ebb746ac40 (diff)
downloadbootstrap-5f316e6dc34f57bfbd0ebf922fe5a01cc6bb38c4.tar.xz
bootstrap-5f316e6dc34f57bfbd0ebf922fe5a01cc6bb38c4.zip
Merge branch 'v4-dev' of https://github.com/twbs/bootstrap into patch-1
Diffstat (limited to 'js/src/tab.js')
-rw-r--r--js/src/tab.js13
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')
+ })
/**