aboutsummaryrefslogtreecommitdiff
path: root/js/src/button/button.js
diff options
context:
space:
mode:
authorMarkus Hatvan <[email protected]>2019-08-22 21:17:34 +0200
committerXhmikosR <[email protected]>2019-08-22 22:17:34 +0300
commit4d101491da094418a768ff2f44be1ca85fd85922 (patch)
treedd6e4fe48b96df3cf4fe4f01839d1dd1aec8e0b2 /js/src/button/button.js
parent6885d65578b4938f3a8fdf1de65946c79415b94d (diff)
downloadbootstrap-4d101491da094418a768ff2f44be1ca85fd85922.tar.xz
bootstrap-4d101491da094418a768ff2f44be1ca85fd85922.zip
Remaining JS linting TODO (#29289)
* Enable and fix all occurrences with no-mixed-operators rule * Take care of the max-depth warning in button.js Signed-off-by: mhatvan <[email protected]>
Diffstat (limited to 'js/src/button/button.js')
-rw-r--r--js/src/button/button.js20
1 files changed, 9 insertions, 11 deletions
diff --git a/js/src/button/button.js b/js/src/button/button.js
index d64f5130e..4418ba6b8 100644
--- a/js/src/button/button.js
+++ b/js/src/button/button.js
@@ -74,17 +74,15 @@ class Button {
if (rootElement) {
const input = SelectorEngine.findOne(Selector.INPUT, this._element)
- if (input) {
- if (input.type === 'radio') {
- if (input.checked &&
- this._element.classList.contains(ClassName.ACTIVE)) {
- triggerChangeEvent = false
- } else {
- const activeElement = SelectorEngine.findOne(Selector.ACTIVE, rootElement)
-
- if (activeElement) {
- activeElement.classList.remove(ClassName.ACTIVE)
- }
+ if (input && input.type === 'radio') {
+ if (input.checked &&
+ this._element.classList.contains(ClassName.ACTIVE)) {
+ triggerChangeEvent = false
+ } else {
+ const activeElement = SelectorEngine.findOne(Selector.ACTIVE, rootElement)
+
+ if (activeElement) {
+ activeElement.classList.remove(ClassName.ACTIVE)
}
}