Skip to content

Commit

Permalink
Fix disabling of mark as read button
Browse files Browse the repository at this point in the history
The button on the notification page was disabled through
a CSS class, which only lead to a disabled look, but still
allowed to submit the form.

Fixes #10248

Co-authored-by: Eduardo Navarro <enavarro@suse.com>
  • Loading branch information
krauselukas and eduardoj committed Oct 8, 2020
1 parent 3e14a78 commit 27d30f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/api/app/assets/javascripts/webui/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ function setCheckboxCounterAndSubmitButton() {
});

if(amountBoxesChecked <= 0) {
$('#done-button').addClass('disabled');
$('#done-button').prop('disabled', true);
$('#select-all-label').text('Select all');
} else {
$('#done-button').removeClass('disabled');
$('#done-button').prop('disabled', false);
$('#select-all-label').text(amountBoxesChecked + ' selected');
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
= check_box_tag('select-all-notifications', 1, false, class: 'custom-control-input')
%label.custom-control-label.align-middle.mr-4#select-all-label{ for: 'select-all-notifications' } Select All
- button_text = type == 'read' ? "Mark as 'Unread'" : "Mark as 'Read'"
= button_tag(type: 'submit', class: 'btn btn-sm btn-outline-success px-3 disabled', id: 'done-button') do
= button_tag(type: 'submit', class: 'btn btn-sm btn-outline-success px-3', id: 'done-button', disabled: 'disabled') do
= button_text

0 comments on commit 27d30f8

Please sign in to comment.