-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚧 [#2145] Attempted to pull apart form fields
- Loading branch information
1 parent
c32001a
commit b9d57be
Showing
3 changed files
with
128 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 18 additions & 18 deletions
36
src/open_inwoner/js/components/form/ChoiceListMultiple.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
// document | ||
// .querySelectorAll('.choice-list-multiple .choice-list-multiple__item label') | ||
// .forEach(function (label) { | ||
// label.addEventListener('click', function () { | ||
// const checkbox = this.querySelector('input[type="checkbox"]') | ||
// const content = this.querySelector('.choice-list-multiple__content') | ||
// | ||
// if (checkbox.checked) { | ||
// content.style.backgroundColor = 'lightcoral' | ||
// content.style.border = '2px solid red' | ||
// content.classList.add('selected') | ||
// } else { | ||
// content.style.backgroundColor = '' | ||
// content.style.border = '' | ||
// content.classList.remove('selected') | ||
// } | ||
// }) | ||
// }) | ||
document | ||
.querySelectorAll('.choice-list-multiple .choice-list-multiple__item label') | ||
.forEach(function (label) { | ||
label.addEventListener('click', function () { | ||
const checkbox = this.querySelector('input[type="checkbox"]') | ||
const content = this.querySelector('.choice-list-multiple__content') | ||
|
||
if (checkbox.checked) { | ||
content.style.backgroundColor = 'lightcoral' | ||
content.style.border = '2px solid red' | ||
content.classList.add('selected') | ||
} else { | ||
content.style.backgroundColor = '' | ||
content.style.border = '' | ||
content.classList.remove('selected') | ||
} | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters