Skip to content

Commit

Permalink
Merge pull request #72 from thesauri/remove-model-error-message
Browse files Browse the repository at this point in the history
Remove new path error messages when closing the modal
  • Loading branch information
c00k133 authored Dec 28, 2019
2 parents 4201201 + f78b0da commit 53ee69e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions fotogalleri/gallery/static/javascript/new_path.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ function getCookie(name) {
}

$(function () {
$('#new-path-form-close').click(function() {
$('#error-msg').remove();
});

$('#new-path-button').click(function () {
if (!!$('#new-path').val()) {
// TODO: error message is only removed when a valid folder name is posted.
// It should be removed when the modal is closed
$('#error-msg').remove();
const crsfToken = getCookie('csrftoken');
const [{ name, value } = {}] = $('#new-path-form').serializeArray();
Expand Down
2 changes: 1 addition & 1 deletion fotogalleri/gallery/templates/modals/create_path.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Add path</p>
<button class="delete" aria-label="close"></button>
<button id="new-path-form-close" class="delete" aria-label="close"></button>
</header>
<section class="modal-card-body">
<form id="new-path-form" method="POST">
Expand Down

0 comments on commit 53ee69e

Please sign in to comment.