editor: add invisible submitbutton to prevent deleting mapitems by hitting return

This commit is contained in:
Laura Klünder 2016-12-08 22:46:02 +01:00
parent 72770d718f
commit eed94a491c
4 changed files with 13 additions and 0 deletions

View file

@ -19,6 +19,16 @@ body {
top:2px;
}
form button.btn.invisiblesubmit {
overflow: visible;
height: 0;
width: 0;
margin: 0;
border: 0;
padding: 0;
display: block;
}
.leaflet-control-layers-toggle {
color:#000000 !important;
font-size:14px;

View file

@ -525,6 +525,7 @@ editor = {
editor.sidebar_get(href);
},
_sidebar_submit_btn_click: function() {
console.log($(this))
// 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('btn', null);

View file

@ -5,6 +5,7 @@
{% csrf_token %}
{% bootstrap_form form %}
{% buttons %}
<button class="invisiblesubmit" type="submit"></button>
{% if not new %}
<button type="submit" name="delete" value="1" class="btn btn-danger">
Delete

View file

@ -7,6 +7,7 @@
<input type="hidden" name="delete" value="1">
<input type="hidden" name="name" value="{{ name }}">
{% buttons %}
<button class="invisiblesubmit" type="submit"></button>
<a class="btn btn-default" href="{% url 'editor.mapitems.level' mapitem_type=mapitem_type level='LEVEL' %}" data-insert-level>
Cancel
</a>