add can_close_modal so close-modal-now is only used it its possible
This commit is contained in:
parent
eda5099190
commit
81da069942
3 changed files with 7 additions and 1 deletions
|
@ -223,6 +223,7 @@ editor = {
|
|||
}
|
||||
var action = $(this).attr('action');
|
||||
editor._sidebar_unload();
|
||||
data += '&can_close_modal=' + ((editor._last_non_modal_path === null) ? '0' : '1');
|
||||
$.post(action, data, editor._sidebar_loaded).fail(editor._sidebar_error);
|
||||
},
|
||||
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
{% include 'editor/fragment_modal_close.html' %}
|
||||
<h3 {% if closemodal %}data-close-modal-now{% endif %}>{% trans 'Graph Editing Settings' %}</h3>
|
||||
|
||||
{% if not closemodal %}
|
||||
{% bootstrap_messages %}
|
||||
{% endif %}
|
||||
|
||||
<form action="{{ request.path }}" method="post">
|
||||
{% csrf_token %}
|
||||
{% bootstrap_form form %}
|
||||
|
|
|
@ -386,7 +386,8 @@ def graph_editing_settings(request):
|
|||
form = GraphEditorSettingsForm(data=request.POST)
|
||||
if form.is_valid():
|
||||
messages.success(request, _('Graph Editing Settings were successfully saved.'))
|
||||
ctx['closemodal'] = True
|
||||
if request.POST.get('can_close_modal') == '1':
|
||||
ctx['closemodal'] = True
|
||||
else:
|
||||
form = GraphEditorSettingsForm()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue