|
[% 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));
+
}
});
}
|