Owen Leonard
38b94cf964
This patch updates the "Remove" button from items which are in a rotating collection (in the "Manage items" stage). A GET link is converted to a posted form. Unrelated: The JavaScript has also been modified so that it asks for confirmation. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
32 lines
952 B
JavaScript
32 lines
952 B
JavaScript
/* global _ dataTablesDefaults */
|
|
|
|
$(document).ready(function(){
|
|
$("#barcode").focus();
|
|
|
|
$(".confirmdelete").click(function(){
|
|
return confirm( __("Are you sure you want to delete this rotating collection?"));
|
|
});
|
|
|
|
$(".removeitem").on("click", function(){
|
|
$(this).parents('tr').addClass("warn");
|
|
if(confirm(__("Are you sure you want to remove this item?"))){
|
|
$(this).parents('form').submit();
|
|
return true;
|
|
} else {
|
|
$(this).parents('tr').removeClass("warn");
|
|
return false;
|
|
}
|
|
});
|
|
|
|
if( $('#rotating-collections-table').length > 0 ){
|
|
$('#rotating-collections-table').dataTable($.extend(true, {}, dataTablesDefaults, {
|
|
"autoWidth": false,
|
|
"columnDefs": [
|
|
{ "targets": [ -1 ], "orderable": false, "searchable": false },
|
|
],
|
|
"pagingType": "full"
|
|
} ));
|
|
}
|
|
|
|
|
|
});
|