From 21a65f181eebc3f2c0cd43fb3383ee3de673745b Mon Sep 17 00:00:00 2001 From: Johann-S Date: Wed, 16 Sep 2015 10:35:29 +0200 Subject: Add throw error for undefined method on plugins --- js/src/modal.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'js/src/modal.js') diff --git a/js/src/modal.js b/js/src/modal.js index f57131e7e..99a49f148 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -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) } -- cgit v1.2.3 From 2d87ec9a64b521807786f476dfe1b7a555b43e4b Mon Sep 17 00:00:00 2001 From: Jon Tewksbury Date: Tue, 3 Nov 2015 15:04:26 -0800 Subject: Add eslint no-undef rule and resolve errors --- js/src/modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/src/modal.js') diff --git a/js/src/modal.js b/js/src/modal.js index 99a49f148..a5f0160c9 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -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 } }) }) -- cgit v1.2.3 From 79a4273891cf7929760abc1954037e6b2e31af9a Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 12 Nov 2015 21:21:32 +0200 Subject: Tweak ESLint rules. --- js/src/modal.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'js/src/modal.js') diff --git a/js/src/modal.js b/js/src/modal.js index a5f0160c9..6fab292f7 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -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}`, -- cgit v1.2.3 From 75c39f9138ea95e8d472812117b13f1ed7978157 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Sat, 5 Dec 2015 02:19:21 -0800 Subject: Fix version numbers is JS files; fixes #18435 [skip sauce] [skip validator] --- js/src/modal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/src/modal.js') diff --git a/js/src/modal.js b/js/src/modal.js index 6fab292f7..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' -- cgit v1.2.3