Bug 30070: (follow-up) Fix javascript errors

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Kyle M Hall 2023-11-14 07:26:59 -05:00 committed by Katrin Fischer
parent 37667e000a
commit f4498d54ac
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 7 additions and 7 deletions

View File

@ -139,14 +139,14 @@
},
{
"title": "Actions",
"className": "actions",
"searchable": false,
"orderable": false,
"render": function( row, type, val, meta ) {
var result = '<a class="btn btn-default btn-xs view_message" target="_blank" href="/cgi-bin/koha/acqui/edimsg.pl?id='+encodeURIComponent(row.id)+'"><i class="fa fa-search"></i> View message</a>';
result += '<a class="btn btn-default btn-xs delete_msg" href="/cgi-bin/koha/acqui/edifactmsgs.pl?op=delete&amp;message_id='+encodeURIComponent(row.id)+'"><i class="fa fa-trash-can"></i> Delete</a>';
"render": function(data, type, row, meta) {
var result = '<a class="btn btn-default btn-xs view_message" target="_blank" href="/cgi-bin/koha/acqui/edimsg.pl?id='+encodeURIComponent(row.id)+'"><i class="fa fa-search"></i> View message</a> ';
result += '<a class="btn btn-default btn-xs delete_msg" href="/cgi-bin/koha/acqui/edifactmsgs.pl?op=delete&amp;message_id='+encodeURIComponent(row.id)+'"><i class="fa fa-trash-can"></i> Delete</a> ';
if ( row.status == 'new' ) {
reslt += '<a class="btn btn-default btn-xs import_msg" href="/cgi-bin/koha/acqui/edifactmsgs.pl?op=import&amp;message_id='+encodeURIComponent(row.id)+'"><i class="fa fa-cog"></i> Import</a>';
result += '<a class="btn btn-default btn-xs import_msg" href="/cgi-bin/koha/acqui/edifactmsgs.pl?op=import&amp;message_id='+encodeURIComponent(row.id)+'"><i class="fa fa-cog"></i> Import</a> ';
}
return result;
}
@ -157,7 +157,7 @@
var EDIModal = $("#EDI_modal");
var EDIModalBody = $("#EDI_modal .modal-body");
$(".view_message").on("click", function(e){
$("body").on("click", ".view_message", function(e){
e.preventDefault();
var page = $(this).attr("href");
EDIModalBody.load(page + " #edimsg");
@ -170,7 +170,7 @@
EDIModal.on("hidden.bs.modal", function(){
EDIModalBody.html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
});
$(".delete_msg").on("click",function(){
$("body").on("click", ".delete_msg" ,function(){
return confirm(_("Are you sure you want to delete this message?"));
});
});