add a javascript confirmation dialog before removing a term (#2986)
This commit is contained in:
parent
bf7de54824
commit
8db1c70c6c
|
@ -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>
|
||||
|
|
Reference in New Issue