diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 438878a6f1..42c49a2403 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -942,7 +942,7 @@ [% FOREACH ar IN current_article_requests %] - + [% INCLUDE 'biblio-title.inc' biblio=ar.biblio link=> 1 %] [% ar.item.enumchron | html %] @@ -1095,7 +1095,7 @@ [% IF ( opac_user_article_requests ) %] $("#opac-user-views a[href='#opac-user-article-requests_panel']").tab("show"); [% END %] - $('#opac-user-article-requests caption .count').html(AR_CAPTION_COUNT.format('[% current_article_requests.size | html %]')); + $('#article-requests-table caption .count').html(AR_CAPTION_COUNT.format('[% current_article_requests.size | html %]')); $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs"); @@ -1123,7 +1123,7 @@ ); }); - $(".btn-delete-article-request").on("click", function(e){ + $("#article-requests-table").on("click", ".btn-delete-article-request", function(e){ e.preventDefault(); var article_request = $(this).data("title"); var article_request_id = $(this).data("article-request_id"); @@ -1134,16 +1134,18 @@ type: "DELETE", url: '/api/v1/public/patrons/'+borrowernumber+'/article_requests/'+article_request_id+'?cancellation_reason=OPAC', success: function( data ) { - row.parents('tr').hide({ + $("#article_" + article_request_id ).hide({ duration: 'slow', complete: function() { - var ar_tab = $('a[href="#opac-user-article-requests"'); + $(this).siblings(".child").hide(); + var ar_tab = $('a[href="#opac-user-article-requests_panel"'); var ar_table = $('#article-requests-table'); var ar_length = $('tbody tr:visible', ar_table).length; var ar_count = $('caption .count', ar_table); ar_tab.html(ar_tab.html().replace(/\(\d+\)/, '('+ar_length+')')); ar_count.html(AR_CAPTION_COUNT.format(ar_length)); + } }); }