mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 11:31:08 +00:00
Close modals after submit
This commit is contained in:
parent
053e2cea0d
commit
49f1226f3a
5 changed files with 10 additions and 4 deletions
|
@ -74,6 +74,12 @@ let StatusCache = new class {
|
|||
.forEach(node => window.localStorage.removeItem(node.dataset.cacheDraft));
|
||||
|
||||
// Close modals
|
||||
let modal = form.closest(".modal.is-active");
|
||||
if (!!modal) {
|
||||
modal.getElementsByClassName("modal-close")[0].click();
|
||||
}
|
||||
|
||||
// Update buttons
|
||||
}
|
||||
}();
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ Finish "<em>{{ book_title }}</em>"
|
|||
{% endblock %}
|
||||
|
||||
{% block modal-form-open %}
|
||||
<form name="finish-reading" action="{% url 'reading-status' 'finish' book.id %}" method="post">
|
||||
<form name="finish-reading" action="{% url 'reading-status' 'finish' book.id %}" method="post" class="submit-status">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="reading_status" value="read">
|
||||
{% endblock %}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block modal-form-open %}
|
||||
<form action="{% url 'edit-readthrough' %}" method="POST">
|
||||
<form action="{% url 'edit-readthrough' %}" method="POST" class="submit-status">
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-body %}
|
||||
|
|
|
@ -9,7 +9,7 @@ Start "<em>{{ book_title }}</em>"
|
|||
{% endblock %}
|
||||
|
||||
{% block modal-form-open %}
|
||||
<form name="start-reading" action="{% url 'reading-status' 'start' book.id %}" method="post">
|
||||
<form name="start-reading" action="{% url 'reading-status' 'start' book.id %}" method="post" class="submit-status">
|
||||
<input type="hidden" name="reading_status" value="reading">
|
||||
{% csrf_token %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -9,7 +9,7 @@ Want to Read "<em>{{ book_title }}</em>"
|
|||
{% endblock %}
|
||||
|
||||
{% block modal-form-open %}
|
||||
<form name="shelve" action="{% url 'reading-status' 'want' book.id %}" method="post">
|
||||
<form name="shelve" action="{% url 'reading-status' 'want' book.id %}" method="post" class="submit-status">
|
||||
<input type="hidden" name="reading_status" value="to-read">
|
||||
{% csrf_token %}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue