editor: if creating a new polygon, hide save button until the geometry is complete

This commit is contained in:
Laura Klünder 2016-12-04 14:22:49 +01:00
parent a4c5651675
commit 779d2fa2f5
2 changed files with 5 additions and 0 deletions

View file

@ -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;
}

View file

@ -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 () {