add a javascript confirmation dialog before removing a term (#2986)

This commit is contained in:
Frédéric Péters 2013-08-22 11:24:02 +02:00
parent bf7de54824
commit 8db1c70c6c
1 changed files with 6 additions and 4 deletions

View File

@ -38,10 +38,12 @@
<script type="text/javascript">
$(document).ready(function() {
$('span.remove').unbind('click').click(function() {
var field = $(this).parents('.field');
var term_id = $(this).parent().attr('data-term-id');
$(field).find('select option[id=' + term_id + ']').remove();
$(this).parent().remove();
if (confirm("Vraiment supprimer ce terme ?") == true) {
var field = $(this).parents('.field');
var term_id = $(this).parent().attr('data-term-id');
$(field).find('select option[id=' + term_id + ']').remove();
$(this).parent().remove();
}
});
});
</script>