editor: add invisible submitbutton to prevent deleting mapitems by hitting return
This commit is contained in:
parent
72770d718f
commit
eed94a491c
4 changed files with 13 additions and 0 deletions
|
@ -19,6 +19,16 @@ body {
|
||||||
top:2px;
|
top:2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
form button.btn.invisiblesubmit {
|
||||||
|
overflow: visible;
|
||||||
|
height: 0;
|
||||||
|
width: 0;
|
||||||
|
margin: 0;
|
||||||
|
border: 0;
|
||||||
|
padding: 0;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
.leaflet-control-layers-toggle {
|
.leaflet-control-layers-toggle {
|
||||||
color:#000000 !important;
|
color:#000000 !important;
|
||||||
font-size:14px;
|
font-size:14px;
|
||||||
|
|
|
@ -525,6 +525,7 @@ editor = {
|
||||||
editor.sidebar_get(href);
|
editor.sidebar_get(href);
|
||||||
},
|
},
|
||||||
_sidebar_submit_btn_click: function() {
|
_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.
|
// 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).closest('form').data('btn', $(this)).clearQueue().delay(300).queue(function() {
|
||||||
$(this).data('btn', null);
|
$(this).data('btn', null);
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{% bootstrap_form form %}
|
{% bootstrap_form form %}
|
||||||
{% buttons %}
|
{% buttons %}
|
||||||
|
<button class="invisiblesubmit" type="submit"></button>
|
||||||
{% if not new %}
|
{% if not new %}
|
||||||
<button type="submit" name="delete" value="1" class="btn btn-danger">
|
<button type="submit" name="delete" value="1" class="btn btn-danger">
|
||||||
Delete
|
Delete
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
<input type="hidden" name="delete" value="1">
|
<input type="hidden" name="delete" value="1">
|
||||||
<input type="hidden" name="name" value="{{ name }}">
|
<input type="hidden" name="name" value="{{ name }}">
|
||||||
{% buttons %}
|
{% 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>
|
<a class="btn btn-default" href="{% url 'editor.mapitems.level' mapitem_type=mapitem_type level='LEVEL' %}" data-insert-level>
|
||||||
Cancel
|
Cancel
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue