diff options
| author | Alexandr Kondrashov <[email protected]> | 2015-12-08 02:18:32 +0300 |
|---|---|---|
| committer | Alexandr Kondrashov <[email protected]> | 2015-12-08 02:18:32 +0300 |
| commit | 5f316e6dc34f57bfbd0ebf922fe5a01cc6bb38c4 (patch) | |
| tree | 2951782d8d0aadb61dae9122d0f508a75ed8e7eb /js/src/modal.js | |
| parent | c9725926b2f30bed4e37f57c20ef8ffeb2fd233b (diff) | |
| parent | afbaf4350560eaf2135fb0dc6dd761ebb746ac40 (diff) | |
| download | bootstrap-5f316e6dc34f57bfbd0ebf922fe5a01cc6bb38c4.tar.xz bootstrap-5f316e6dc34f57bfbd0ebf922fe5a01cc6bb38c4.zip | |
Merge branch 'v4-dev' of https://github.com/twbs/bootstrap into patch-1
Diffstat (limited to 'js/src/modal.js')
| -rw-r--r-- | js/src/modal.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/js/src/modal.js b/js/src/modal.js index f57131e7e..5a90b2238 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -3,7 +3,7 @@ import Util from './util' /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0): modal.js + * Bootstrap (v4.0.0-alpha): modal.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -18,7 +18,7 @@ const Modal = (($) => { */ const NAME = 'modal' - const VERSION = '4.0.0' + const VERSION = '4.0.0-alpha' const DATA_KEY = 'bs.modal' const EVENT_KEY = `.${DATA_KEY}` const DATA_API_KEY = '.data-api' @@ -41,10 +41,10 @@ const Modal = (($) => { } const Event = { - HIDE : `hide${EVENT_KEY}`, - HIDDEN : `hidden${EVENT_KEY}`, - SHOW : `show${EVENT_KEY}`, - SHOWN : `shown${EVENT_KEY}`, + HIDE : `hide${EVENT_KEY}`, + HIDDEN : `hidden${EVENT_KEY}`, + SHOW : `show${EVENT_KEY}`, + SHOWN : `shown${EVENT_KEY}`, FOCUSIN : `focusin${EVENT_KEY}`, RESIZE : `resize${EVENT_KEY}`, CLICK_DISMISS : `click.dismiss${EVENT_KEY}`, @@ -138,7 +138,7 @@ const Modal = (($) => { $(this._dialog).on(Event.MOUSEDOWN_DISMISS, () => { $(this._element).one(Event.MOUSEUP_DISMISS, (event) => { if ($(event.target).is(this._element)) { - that._ignoreBackdropClick = true + this._ignoreBackdropClick = true } }) }) @@ -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) } |
