aboutsummaryrefslogtreecommitdiff
path: root/js/src/button.js
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2018-06-01 14:44:21 +0200
committerJohann-S <[email protected]>2018-06-03 11:40:08 +0200
commita79b8aa16ab5fa5c71a91425d8464f0bdcd3fe37 (patch)
tree201e8438a9df0d1e951bee801808a396fd3fc098 /js/src/button.js
parentffd31f9b8c8b3a34df888fd66218ee74f1fcaf28 (diff)
downloadbootstrap-a79b8aa16ab5fa5c71a91425d8464f0bdcd3fe37.tar.xz
bootstrap-a79b8aa16ab5fa5c71a91425d8464f0bdcd3fe37.zip
refactor(plugins): query elements without jquery
Diffstat (limited to 'js/src/button.js')
-rw-r--r--js/src/button.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/js/src/button.js b/js/src/button.js
index 1065ae6d7..442640dfe 100644
--- a/js/src/button.js
+++ b/js/src/button.js
@@ -68,15 +68,15 @@ const Button = (($) => {
)[0]
if (rootElement) {
- const input = $(this._element).find(Selector.INPUT)[0]
+ const input = this._element.querySelector(Selector.INPUT)
if (input) {
if (input.type === 'radio') {
if (input.checked &&
- $(this._element).hasClass(ClassName.ACTIVE)) {
+ this._element.classList.contains(ClassName.ACTIVE)) {
triggerChangeEvent = false
} else {
- const activeElement = $(rootElement).find(Selector.ACTIVE)[0]
+ const activeElement = rootElement.querySelector(Selector.ACTIVE)
if (activeElement) {
$(activeElement).removeClass(ClassName.ACTIVE)
@@ -91,7 +91,7 @@ const Button = (($) => {
rootElement.classList.contains('disabled')) {
return
}
- input.checked = !$(this._element).hasClass(ClassName.ACTIVE)
+ input.checked = !this._element.classList.contains(ClassName.ACTIVE)
$(input).trigger('change')
}
@@ -102,7 +102,7 @@ const Button = (($) => {
if (addAriaPressed) {
this._element.setAttribute('aria-pressed',
- !$(this._element).hasClass(ClassName.ACTIVE))
+ !this._element.classList.contains(ClassName.ACTIVE))
}
if (triggerChangeEvent) {