Skip to content

Commit

Permalink
Show unsaved changes also at bottom (for small displays)
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Nov 23, 2024
1 parent 2701f3b commit 8096694
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/assets/javascripts/profile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
$(document).ready(function () {
$("#profileForm").on("change input", function () {
$("#profileChange").removeClass("d-none");
$("#profileChangeBottom").removeClass("d-none");
});

$('input:checkbox[name^="user[lecture"]').on("change", function () {
Expand Down
8 changes: 8 additions & 0 deletions app/views/profile/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@
</div>
</div>

<!-- ⭕ Unsaved changes warning/button -->
<!-- Here at the bottom only for small displays -->
<div class="w-100 mt-3 mb-3 d-md-none">
<%= f.submit t('profile.changes_made_btn'),
class: 'btn btn-warning w-100 d-none',
id: "profileChangeBottom" %>
</div>

</div>

<% end %>
Expand Down

0 comments on commit 8096694

Please sign in to comment.