Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2017-12-16 15:00:38 +0300
committerXhmikosR <xhmikosr@gmail.com>2018-01-11 19:48:46 +0300
commit80d0943b95984bfaf4997d2198d467876d294bd8 (patch)
treefa2eb4c869753b6e20c771a928da460587f38fdf /js/src/button.js
parent6d336502c7e26c4cc5b35f1d7a19c067b774cb1f (diff)
Comply to the new rules.
Diffstat (limited to 'js/src/button.js')
-rw-r--r--js/src/button.js29
1 files changed, 8 insertions, 21 deletions
diff --git a/js/src/button.js b/js/src/button.js
index 56688e2462..445e78938b 100644
--- a/js/src/button.js
+++ b/js/src/button.js
@@ -8,8 +8,6 @@ import $ from 'jquery'
*/
const Button = (($) => {
-
-
/**
* ------------------------------------------------------------------------
* Constants
@@ -39,11 +37,10 @@ const Button = (($) => {
const Event = {
CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`,
- FOCUS_BLUR_DATA_API : `focus${EVENT_KEY}${DATA_API_KEY} `
- + `blur${EVENT_KEY}${DATA_API_KEY}`
+ FOCUS_BLUR_DATA_API : `focus${EVENT_KEY}${DATA_API_KEY} ` +
+ `blur${EVENT_KEY}${DATA_API_KEY}`
}
-
/**
* ------------------------------------------------------------------------
* Class Definition
@@ -51,25 +48,22 @@ const Button = (($) => {
*/
class Button {
-
constructor(element) {
this._element = element
}
-
- // getters
+ // Getters
static get VERSION() {
return VERSION
}
-
- // public
+ // Public
toggle() {
let triggerChangeEvent = true
let addAriaPressed = true
- const rootElement = $(this._element).closest(
+ const rootElement = $(this._element).closest(
Selector.DATA_TOGGLE
)[0]
@@ -81,7 +75,6 @@ const Button = (($) => {
if (input.checked &&
$(this._element).hasClass(ClassName.ACTIVE)) {
triggerChangeEvent = false
-
} else {
const activeElement = $(rootElement).find(Selector.ACTIVE)[0]
@@ -105,7 +98,6 @@ const Button = (($) => {
input.focus()
addAriaPressed = false
}
-
}
if (addAriaPressed) {
@@ -123,8 +115,7 @@ const Button = (($) => {
this._element = null
}
-
- // static
+ // Static
static _jQueryInterface(config) {
return this.each(function () {
@@ -140,10 +131,8 @@ const Button = (($) => {
}
})
}
-
}
-
/**
* ------------------------------------------------------------------------
* Data Api implementation
@@ -167,22 +156,20 @@ const Button = (($) => {
$(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type))
})
-
/**
* ------------------------------------------------------------------------
* jQuery
* ------------------------------------------------------------------------
*/
- $.fn[NAME] = Button._jQueryInterface
+ $.fn[NAME] = Button._jQueryInterface
$.fn[NAME].Constructor = Button
- $.fn[NAME].noConflict = function () {
+ $.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT
return Button._jQueryInterface
}
return Button
-
})($)
export default Button