aboutsummaryrefslogtreecommitdiff
path: root/js/src/button.js
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2016-12-28 15:52:28 -0800
committerMark Otto <[email protected]>2016-12-28 15:52:28 -0800
commit047d4a77da5af8b59fd562935669c550272f57a6 (patch)
tree7a2daf4d737693826c6d264113adc6e987c3ae2a /js/src/button.js
parent11d52ba9498990483d822a5a42d371393a110080 (diff)
parente1e621be046a4541a2fd36e445015ee44de3c67e (diff)
downloadbootstrap-047d4a77da5af8b59fd562935669c550272f57a6.tar.xz
bootstrap-047d4a77da5af8b59fd562935669c550272f57a6.zip
Merge branch 'v4-dev' into v4-docs-streamlined
Diffstat (limited to 'js/src/button.js')
-rw-r--r--js/src/button.js14
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))
})