Skip to content

Commit

Permalink
Merge pull request #6963 from samvera/issue-6814
Browse files Browse the repository at this point in the history
Disable/enable Save button via aria-disabled attribute
  • Loading branch information
randalldfloyd authored Nov 6, 2024
2 parents c56c4a8 + 8ebf706 commit 153d573
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/assets/javascripts/hyrax/file_manager/save_manager.es6
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ export default class SaveManager {
check_button() {
if (this.is_changed) {
this.save_button.removeClass("disabled")
this.save_button.attr("aria-disabled", "false")
} else {
this.save_button.addClass("disabled")
this.save_button.attr("aria-disabled", "true")
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/base/_file_manager_actions.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="actions card">
<div class="d-flex">
<%= button_tag t('.save'), class: "btn btn-primary disabled mr-2", data: { action: "save-actions" } %>
<%= button_tag t('.save'), class: "btn btn-primary disabled mr-2", data: { action: "save-actions" }, 'aria-disabled': true %>
<%= button_tag t('.sort_alphabetically'), class: "btn btn-primary ", data: { action: "alpha-sort-action" } %>
</div>
</div>
Expand Down

0 comments on commit 153d573

Please sign in to comment.