diff --git a/the_works/static/js/modal.js b/the_works/static/js/modal.js index 002592a..b182ec4 100644 --- a/the_works/static/js/modal.js +++ b/the_works/static/js/modal.js @@ -11,10 +11,11 @@ function initModal(modal_id, input_ids, headings, form_actions) { for (const el of document.querySelectorAll('.action-update')) { el.addEventListener("click", event => showDialog(modal_id, input_ids, headings[1], form_actions[1], input_ids.map(input => event.currentTarget.dataset[input.slice(5).toLowerCase()]), event.currentTarget.dataset.id)); } - // add event listener to close button - document.querySelector("dialog button.modal-close").addEventListener("click", event => { +/* // add event listener to close button + document.querySelector("dialog button.modal-close").addEventListener("click", event => { event.target.closest("dialog").close(); - }); + event.preventDefault(); + }); */ } @@ -27,6 +28,7 @@ function showDialog(modal_id, input_ids, heading, form_action, input_values, url // set modal attributes document.getElementById("dialog-heading").textContent = heading; document.getElementById("form_submit").formAction = form_action; + document.getElementById("form_submit").form.action = form_action; for (var i = 0; i < input_ids.length; i++ ) { document.getElementById(input_ids[i]).value = input_values[i] || ""; } diff --git a/the_works/templates/views/genre.html b/the_works/templates/views/genre.html index 79fd699..c6f3f88 100644 --- a/the_works/templates/views/genre.html +++ b/the_works/templates/views/genre.html @@ -32,10 +32,10 @@
-
+
- -

#

+ +