close modal when graph editing settings are saved
This commit is contained in:
parent
d5041414e6
commit
eda5099190
3 changed files with 17 additions and 2 deletions
|
@ -146,6 +146,10 @@ editor = {
|
|||
if (!is_modal) {
|
||||
editor._last_non_modal_path = editor.get_location_path();
|
||||
} else if (editor._last_non_modal_path !== null) {
|
||||
if (content.find('[data-close-modal-now]').length) {
|
||||
editor.sidebar_get(editor._last_non_modal_path);
|
||||
return;
|
||||
}
|
||||
modal_close.attr('href', editor._last_non_modal_path).show();
|
||||
} else {
|
||||
modal_close.remove();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{% load i18n %}
|
||||
|
||||
{% include 'editor/fragment_modal_close.html' %}
|
||||
<h3>{% trans 'Graph Editing Settings' %}</h3>
|
||||
<h3 {% if closemodal %}data-close-modal-now{% endif %}>{% trans 'Graph Editing Settings' %}</h3>
|
||||
|
||||
<form action="{{ request.path }}" method="post">
|
||||
{% csrf_token %}
|
||||
|
|
|
@ -380,6 +380,17 @@ def graph_edit(request, level=None, space=None):
|
|||
@sidebar_view
|
||||
def graph_editing_settings(request):
|
||||
ctx = {
|
||||
'form': GraphEditorSettingsForm(),
|
||||
'closemodal': False,
|
||||
}
|
||||
if request.method == 'POST':
|
||||
form = GraphEditorSettingsForm(data=request.POST)
|
||||
if form.is_valid():
|
||||
messages.success(request, _('Graph Editing Settings were successfully saved.'))
|
||||
ctx['closemodal'] = True
|
||||
else:
|
||||
form = GraphEditorSettingsForm()
|
||||
|
||||
ctx.update({
|
||||
'form': form,
|
||||
})
|
||||
return render(request, 'editor/graph_editing_settings.html', ctx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue