Skip to content

Commit

Permalink
Fix: collapse form when errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tvlooy committed Nov 26, 2024
1 parent bef050a commit 9c92708
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 1 addition & 7 deletions assets/js/party.manage.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ $(document).ready(function () {
$('.link_remove_participant').click(function (e) {
$('#delete-participant').show();
$('.link_remove_participant').attr('disabled', true);
$('.link_remove_participant').attr('disabled', true);
$('#delete-participant-confirmation').focus();
var listUrl = $(this).data('listurl');
var participantUrl = $(this).data('participant');
Expand Down Expand Up @@ -68,13 +69,6 @@ $(document).ready(function () {
submitEditForm($(this).data('listurl'), $(this).data('participant-url'));
});
});
function showExcludeErrors() {
alert('bar');
$('#collapsedMessage').collapse('show');
$('html, body').animate({
scrollTop: $("#collapsedMessage").offset().top
}, 2000);
}

function editParticipant(listUrl, participantUrl) {
var email = $('#email_' + participantUrl).html();
Expand Down
5 changes: 4 additions & 1 deletion templates/Party/manage/valid.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,10 @@
<script type="text/javascript">
$(document).ready(function () {
{% if excludeForm.participants.vars.valid and excludeForm.vars.errors | length %}
showExcludeErrors();
$('#collapsedMessage').collapse('show');
$('html, body').animate({
scrollTop: $("#collapsedMessage").offset().top
}, 2000);
{% endif %}
});
</script>
Expand Down

0 comments on commit 9c92708

Please sign in to comment.