aboutsummaryrefslogtreecommitdiff
path: root/js/src/button.js
diff options
context:
space:
mode:
authorPierre-Denis Vanduynslager <[email protected]>2016-12-28 19:57:38 -0500
committerPierre-Denis Vanduynslager <[email protected]>2016-12-28 19:57:38 -0500
commit425d156df27fa6c18e979aa000bfe5a346ee3450 (patch)
tree4157dfcbdf8334e9d9fb2bb239f4ae78706bbc71 /js/src/button.js
parentab2fc63d08b8c53d6f29bcfd73b7f2d5ceaacacd (diff)
parente1e621be046a4541a2fd36e445015ee44de3c67e (diff)
downloadbootstrap-425d156df27fa6c18e979aa000bfe5a346ee3450.tar.xz
bootstrap-425d156df27fa6c18e979aa000bfe5a346ee3450.zip
Merge branch 'twbs/v4-dev' into dropdown-keyboard
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 39e2b3974..45e1424ff 100644
--- a/js/src/button.js
+++ b/js/src/button.js
@@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-alpha.2): 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.2'
+ 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))
})