Owen Leonard
1e746becc2
This patch modifies the staff client's rotating collections templates so that JavaScript is included in the footer instead of the header. The patch moves JavaScript from each template and the rotating collections toolbar into a single external JavaScript file. To test, apply the patch and test the JavaScript-driven features of each page: All button controls, DataTables functionality, form validation, etc. Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
27 lines
787 B
JavaScript
27 lines
787 B
JavaScript
/* global _ dataTablesDefaults */
|
|
|
|
$(document).ready(function(){
|
|
$("#barcode").focus();
|
|
|
|
$(".confirmdelete").click(function(){
|
|
$(this).parents('tr').addClass("warn");
|
|
if(confirm(_("Are you sure you want to delete this rotating collection?"))){
|
|
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,
|
|
"aoColumnDefs": [
|
|
{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
|
|
],
|
|
"sPaginationType": "four_button"
|
|
} ));
|
|
}
|
|
|
|
|
|
});
|