From f78b0daa4b571ddd6e5ed9d7a29e36059319b035 Mon Sep 17 00:00:00 2001 From: Walter Berggren Date: Sat, 28 Dec 2019 22:07:10 +0100 Subject: [PATCH] Remove new path error messages when closing the modal --- fotogalleri/gallery/static/javascript/new_path.js | 6 ++++-- fotogalleri/gallery/templates/modals/create_path.html | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fotogalleri/gallery/static/javascript/new_path.js b/fotogalleri/gallery/static/javascript/new_path.js index 3f830e5..a81cb38 100644 --- a/fotogalleri/gallery/static/javascript/new_path.js +++ b/fotogalleri/gallery/static/javascript/new_path.js @@ -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(); diff --git a/fotogalleri/gallery/templates/modals/create_path.html b/fotogalleri/gallery/templates/modals/create_path.html index 8ff12ce..2ebd030 100644 --- a/fotogalleri/gallery/templates/modals/create_path.html +++ b/fotogalleri/gallery/templates/modals/create_path.html @@ -10,7 +10,7 @@