From 779d2fa2f535c638a9bf66089066b1c1436cae10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Sun, 4 Dec 2016 14:22:49 +0100 Subject: [PATCH] editor: if creating a new polygon, hide save button until the geometry is complete --- src/c3nav/editor/static/editor/css/editor.css | 3 +++ src/c3nav/editor/static/editor/js/editor.js | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/c3nav/editor/static/editor/css/editor.css b/src/c3nav/editor/static/editor/css/editor.css index d4b274b5..33fd3623 100644 --- a/src/c3nav/editor/static/editor/css/editor.css +++ b/src/c3nav/editor/static/editor/css/editor.css @@ -44,6 +44,9 @@ body { background-repeat:no-repeat; background-position:center; } +#mapeditcontrols form.creation-lock .btn.btn-primary { + display:none; +} #mapeditcontrols h3 { margin-top:5px; } diff --git a/src/c3nav/editor/static/editor/js/editor.js b/src/c3nav/editor/static/editor/js/editor.js index 528f7e5c..26113868 100644 --- a/src/c3nav/editor/static/editor/js/editor.js +++ b/src/c3nav/editor/static/editor/js/editor.js @@ -274,6 +274,7 @@ editor = { editor._editing.enableEdit(); } else if (form.is('[data-geomtype]')) { // create new geometry + form.addClass('creation-lock'); var geomtype = form.attr('data-geomtype'); var options = editor._get_mapitem_type_style(mapitem_type); @@ -326,6 +327,7 @@ editor = { editor._editing.addTo(editor._editing_layer); editor._editing.on('click', editor._click_editing_layer); editor._update_editing(); + $('#mapeditcontrols').find('form.creation-lock').removeClass('creation-lock'); } }, _update_editing: function () {