1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-27 05:49:07 +02:00

Make JS compliant with the new ESLint rules.

This commit is contained in:
Bardi Harborow
2016-11-22 01:36:00 +11:00
parent 26c16743fc
commit c2616fb74e
22 changed files with 234 additions and 260 deletions

View File

@@ -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)
@@ -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))
})