Skip to content

Commit

Permalink
Update visual checkboxes to reflect the state of the actual checkboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
mathjazz committed Sep 17, 2024
1 parent 604dfb2 commit f6ce601
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pontoon/messaging/static/js/messaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,14 @@ $(function () {
}
});

// Make sure custom checkboxes reflect the state of the HTML checkboxes
// TODO: Replace checkboxes with native HTML checkboxes and style them with CSS
$(`[type=checkbox]`).each(function () {
const name = $(this).attr('name');
const isChecked = $(this)[0].checked;
$(`.check-box[data-attribute=${name}]`).toggleClass('enabled', isChecked);
});

// Toggle between Edit and Review mode
container.on('click', '.controls .toggle.button', function (e) {
e.preventDefault();
Expand Down

0 comments on commit f6ce601

Please sign in to comment.