set graph_editing to keyword instead of all settings
This commit is contained in:
parent
4ccb9ef339
commit
a55d1f366d
3 changed files with 5 additions and 4 deletions
|
@ -489,7 +489,7 @@ editor = {
|
|||
|
||||
var graph_editing = sidebarcontent.find('[data-graph-editing]');
|
||||
if (graph_editing.length) {
|
||||
editor._graph_editing = JSON.parse(graph_editing.attr('data-graph-editing'));
|
||||
editor._graph_editing = graph_editing.attr('data-graph-editing');
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</small>
|
||||
</h3>
|
||||
|
||||
<a href="{% url 'editor.graph.settings' %}" class="btn btn-default btn-xs pull-right" data-graph-editing="{{ graph_editing_settings }}">{% trans 'Settings' %}</a>
|
||||
<a href="{% url 'editor.graph.settings' %}" class="btn btn-default btn-xs pull-right" data-graph-editing="{{ graph_editing }}">{% trans 'Settings' %}</a>
|
||||
<p>
|
||||
<a href="{{ back_url }}">« {{ back_title }}</a>
|
||||
</p>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import json
|
||||
import typing
|
||||
from contextlib import suppress
|
||||
|
||||
|
@ -372,11 +371,13 @@ def graph_edit(request, level=None, space=None):
|
|||
graph_editing_settings = {field.name: field.initial for field in GraphEditorSettingsForm()}
|
||||
graph_editing_settings.update(request.session.get('graph_editing_settings', {}))
|
||||
|
||||
graph_editing = 'edit-nodes' if graph_editing_settings.get('click_anywhere') == 'noop' else 'edit-create-nodes'
|
||||
|
||||
ctx.update({
|
||||
'node_form': GraphNode.EditorForm(request=request),
|
||||
'edge_form': GraphEdge.EditorForm(request=request),
|
||||
'settings_form': GraphEditorSettingsForm(),
|
||||
'graph_editing_settings': json.dumps(graph_editing_settings, separators=(',', ':'))
|
||||
'graph_editing': graph_editing,
|
||||
})
|
||||
|
||||
return render(request, 'editor/graph.html', ctx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue