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:
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 d64f5130e2..4418ba6b87 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)
}
}