diff --git a/src/c3nav/editor/static/editor/js/editor.js b/src/c3nav/editor/static/editor/js/editor.js index 909ed405..4a9cd716 100644 --- a/src/c3nav/editor/static/editor/js/editor.js +++ b/src/c3nav/editor/static/editor/js/editor.js @@ -324,8 +324,10 @@ editor = { edit_form_loaded: function() { $('#mapeditcontrols').addClass('detail'); $('#id_level').val(editor._level); - $('#id_geometry').val(JSON.stringify(editor._editing.toGeoJSON().geometry)); - editor._editing.enableEdit(); + if ($('#id_geometry').length) { + $('#id_geometry').val(JSON.stringify(editor._editing.toGeoJSON().geometry)); + editor._editing.enableEdit(); + } if (editor._editing.options.geomtype == 'polygon') { editor._editing.on('click', function (e) { if ((e.originalEvent.ctrlKey || e.originalEvent.metaKey) && this.editEnabled()) { @@ -372,7 +374,9 @@ editor = { if ($('
').append(content).find('form').length > 0) { $('#mapeditdetail').html(content); $('#mapeditcontrols').addClass('detail'); - editor._editing.enableEdit(); + if ($('#id_geometry').length) { + editor._editing.enableEdit(); + } } else { if (editor._creating !== null) { editor._editing.remove();