diff options
| author | Mark Otto <[email protected]> | 2017-05-26 22:28:09 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2017-05-26 22:28:09 -0700 |
| commit | 6c3f833076a9fa68601741e3e21bd07ad79b7d8a (patch) | |
| tree | fe016946d77f9ffff15bbe9cdc593fd098b5bcc7 /js/src/button.js | |
| parent | c581564a780974c6430ac5897740006f623f2277 (diff) | |
| parent | 5d7db507396275fcda96935aff47b09e1d79ddc1 (diff) | |
| download | bootstrap-6c3f833076a9fa68601741e3e21bd07ad79b7d8a.tar.xz bootstrap-6c3f833076a9fa68601741e3e21bd07ad79b7d8a.zip | |
Merge branch 'v4-docs-streamlined' of https://github.com/twbs/bootstrap into v4-docs-streamlined
Diffstat (limited to 'js/src/button.js')
| -rw-r--r-- | js/src/button.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/js/src/button.js b/js/src/button.js index 24b0cd414..45e1424ff 100644 --- a/js/src/button.js +++ b/js/src/button.js @@ -1,6 +1,6 @@ /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-alpha.4): button.js + * Bootstrap (v4.0.0-alpha.5): button.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -15,7 +15,7 @@ const Button = (($) => { */ const NAME = 'button' - const VERSION = '4.0.0-alpha.4' + const VERSION = '4.0.0-alpha.5' const DATA_KEY = 'bs.button' const EVENT_KEY = `.${DATA_KEY}` const DATA_API_KEY = '.data-api' @@ -66,12 +66,12 @@ const Button = (($) => { toggle() { let triggerChangeEvent = true - let rootElement = $(this._element).closest( + const rootElement = $(this._element).closest( Selector.DATA_TOGGLE )[0] if (rootElement) { - let input = $(this._element).find(Selector.INPUT)[0] + const input = $(this._element).find(Selector.INPUT)[0] if (input) { if (input.type === 'radio') { @@ -80,7 +80,7 @@ const Button = (($) => { triggerChangeEvent = false } else { - let activeElement = $(rootElement).find(Selector.ACTIVE)[0] + const activeElement = $(rootElement).find(Selector.ACTIVE)[0] if (activeElement) { $(activeElement).removeClass(ClassName.ACTIVE) @@ -90,7 +90,7 @@ const Button = (($) => { if (triggerChangeEvent) { input.checked = !$(this._element).hasClass(ClassName.ACTIVE) - $(this._element).trigger('change') + $(input).trigger('change') } input.focus() @@ -151,7 +151,7 @@ const Button = (($) => { Button._jQueryInterface.call($(button), 'toggle') }) .on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => { - let button = $(event.target).closest(Selector.BUTTON)[0] + const button = $(event.target).closest(Selector.BUTTON)[0] $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type)) }) |
