aboutsummaryrefslogtreecommitdiff
path: root/js/dist/button.js
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2018-06-21 22:55:23 -0700
committerMark Otto <[email protected]>2018-06-21 22:55:23 -0700
commiteadeab9d1cf6a1d8315a5aab35f247034931ea6e (patch)
tree660e3dd5d924afcf3cd595ac7dd41fb86842cdc9 /js/dist/button.js
parente59265c42db4c9fec397fd92e9646def0b2b4200 (diff)
downloadbootstrap-eadeab9d1cf6a1d8315a5aab35f247034931ea6e.tar.xz
bootstrap-eadeab9d1cf6a1d8315a5aab35f247034931ea6e.zip
dist
Diffstat (limited to 'js/dist/button.js')
-rw-r--r--js/dist/button.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/js/dist/button.js b/js/dist/button.js
index 3b964fac2..c0d955888 100644
--- a/js/dist/button.js
+++ b/js/dist/button.js
@@ -60,14 +60,14 @@ var Button = function ($) {
var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0];
if (rootElement) {
- var input = $(this._element).find(Selector.INPUT)[0];
+ var input = this._element.querySelector(Selector.INPUT);
if (input) {
if (input.type === 'radio') {
- if (input.checked && $(this._element).hasClass(ClassName.ACTIVE)) {
+ if (input.checked && this._element.classList.contains(ClassName.ACTIVE)) {
triggerChangeEvent = false;
} else {
- var activeElement = $(rootElement).find(Selector.ACTIVE)[0];
+ var activeElement = rootElement.querySelector(Selector.ACTIVE);
if (activeElement) {
$(activeElement).removeClass(ClassName.ACTIVE);
@@ -80,7 +80,7 @@ var Button = function ($) {
return;
}
- input.checked = !$(this._element).hasClass(ClassName.ACTIVE);
+ input.checked = !this._element.classList.contains(ClassName.ACTIVE);
$(input).trigger('change');
}
@@ -90,7 +90,7 @@ var Button = function ($) {
}
if (addAriaPressed) {
- this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE));
+ this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName.ACTIVE));
}
if (triggerChangeEvent) {