From 24611c88639e7ae5d4721a144a34371d282ed795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Thu, 1 Dec 2016 12:36:26 +0100 Subject: [PATCH] editor: fix deleting mapitems --- src/c3nav/editor/static/editor/js/editor.js | 13 +++++++++---- .../editor/templates/editor/mapitem_delete.html | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/c3nav/editor/static/editor/js/editor.js b/src/c3nav/editor/static/editor/js/editor.js index 9667d273..fb910e66 100644 --- a/src/c3nav/editor/static/editor/js/editor.js +++ b/src/c3nav/editor/static/editor/js/editor.js @@ -384,20 +384,25 @@ editor = { _sidebar_submit_btn_click: function() { // listener for submit-button-clicks in the sidebar, so the submit event will know which button submitted. $(this).closest('form').data('btn', $(this)).clearQueue().delay(300).queue(function() { - $(this).data('button', null); + $(this).data('btn', null); }); }, _sidebar_submit: function(e) { // listener for form submits in the sidebar. if ($(this).attr('name') == 'redirect') return; e.preventDefault(); - editor._sidebar_unload(); var data = $(this).serialize(); var btn = $(this).data('btn'); - if (btn !== undefined && btn !== null && $(btn).is('[name]')) { - data += '&'+$('').attr('name', $(btn).attr('name')).val($(btn).val()).serialize(); + if (btn !== undefined && btn !== null) { + if ($(btn).is('[name]')) { + data += '&' + $('').attr('name', $(btn).attr('name')).val($(btn).val()).serialize(); + } + if ($(btn).is('[data-reload-geometries]')) { + editor._get_geometries_next_time = true; + } } var action = $(this).attr('action'); + editor._sidebar_unload(); $.post(action, data, editor._sidebar_loaded); } }; diff --git a/src/c3nav/editor/templates/editor/mapitem_delete.html b/src/c3nav/editor/templates/editor/mapitem_delete.html index e46e9d24..ffd1ad5e 100644 --- a/src/c3nav/editor/templates/editor/mapitem_delete.html +++ b/src/c3nav/editor/templates/editor/mapitem_delete.html @@ -7,10 +7,10 @@ {% buttons %} - + Cancel - {% endbuttons %}