diff --git a/src/c3nav/editor/static/editor/js/editor.js b/src/c3nav/editor/static/editor/js/editor.js index 0dc0629f..6740701c 100644 --- a/src/c3nav/editor/static/editor/js/editor.js +++ b/src/c3nav/editor/static/editor/js/editor.js @@ -110,6 +110,17 @@ editor = { // unload the sidebar. called on sidebar_get and form submit. editor._level_control.disable(); editor._sublevel_control.disable(); + + if (editor._source_image_layer) { + editor._source_image_layer.remove(); + editor._source_image_layer = null; + } + + if (editor._fixed_point_layer) { + editor._fixed_point_layer.remove(); + editor._fixed_point_layer = null; + } + $('#sidebar').addClass('loading').find('.content').html(''); editor._cancel_editing(); }, @@ -150,11 +161,6 @@ editor = { $('#navbar-collapse').find('.nav').html(nav.html()); } - if (editor._source_image_layer) { - editor._source_image_layer.remove(); - editor._source_image_layer = null; - } - var group; if (content.find('[name=fixed_x]')) { $('[name=name]').change(editor._source_name_selected).change(); @@ -169,6 +175,8 @@ editor = { group.append(content.find('[name=fixed_x]').closest('.form-group')); group.append(content.find('[name=fixed_y]').closest('.form-group')); + content.find('[name=fixed_x], [name=fixed_y]').change(editor._fixed_point_changed).change(); + group = $('