Unverified Commit 1e7abc6a authored by Serge S. Koval's avatar Serge S. Koval Committed by GitHub

Merge pull request #1677 from ufo911/master

Ask before removing Inline list items (inline-remove-field class)
parents 49dc9b4f 75221862
......@@ -604,9 +604,11 @@
// Add on event handler
$('body').on('click', '.inline-remove-field' , function(e) {
e.preventDefault();
var r = confirm($('.inline-remove-field').attr('value'));
var form = $(this).closest('.inline-field');
if ( r == true ){
form.remove();
}
});
// Expose faForm globally
......
......@@ -12,7 +12,7 @@
<input type="checkbox" name="del-{{ subfield.id }}" id="del-{{ subfield.id }}" />
<label for="del-{{ subfield.id }}" style="display: inline">{{ _gettext('Delete?') }}</label>
{% else %}
<a href="javascript:void(0)" class="inline-remove-field"><i class="fa fa-times icon-remove"></i></a>
<a href="javascript:void(0)" value="{{ _gettext('Are you sure you want to delete this record?') }}" class="inline-remove-field"><i class="fa fa-times icon-remove"></i></a>
{% endif %}
</div>
</legend>
......@@ -29,7 +29,7 @@
<legend>
{{ _gettext('New') }} {{ field.label.text }}
<div class="pull-right">
<a href="javascript:void(0)" class="inline-remove-field"><i class="fa fa-times icon-remove"></i></a>
<a href="javascript:void(0)" value="{{ _gettext('Are you sure you want to delete this record?') }}" class="inline-remove-field"><i class="fa fa-times icon-remove"></i></a>
</div>
</legend>
{{ render(template) }}
......
......@@ -13,7 +13,7 @@
<input type="checkbox" name="del-{{ subfield.id }}" id="del-{{ subfield.id }}" />
<label for="del-{{ subfield.id }}" style="display: inline">{{ _gettext('Delete?') }}</label>
{% else %}
<a href="javascript:void(0)" class="inline-remove-field"><i class="fa fa-times glyphicon glyphicon-remove"></i></a>
<a href="javascript:void(0)" value="{{ _gettext('Are you sure you want to delete this record?') }}" class="inline-remove-field"><i class="fa fa-times glyphicon glyphicon-remove"></i></a>
{% endif %}
</div>
</small>
......@@ -32,7 +32,7 @@
<legend>
<small>{{ _gettext('New') }} {{ field.label.text }}</small>
<div class="pull-right">
<a href="javascript:void(0)" class="inline-remove-field"><span class="fa fa-times glyphicon glyphicon-remove"></span></a>
<a href="javascript:void(0)" value="{{ _gettext('Are you sure you want to delete this record?') }}" class="inline-remove-field"><span class="fa fa-times glyphicon glyphicon-remove"></span></a>
</div>
</legend>
<div class='clearfix'></div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment