From dac1236694cbc955e58f8369cffe14b3ef5d768d Mon Sep 17 00:00:00 2001 From: Agustin Moyano Date: Thu, 26 Mar 2020 21:48:40 +0000 Subject: [PATCH] Bug 20936: (follow-up) use modified by bug 24980, fix display of page info and fix search without enter --- .../bootstrap/en/modules/opac-holdsrecord.tt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdsrecord.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdsrecord.tt index b68dcbe190..ec997f75d5 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdsrecord.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdsrecord.tt @@ -156,7 +156,12 @@ } }, {"data": "branch.name"}, - {"data": "hold_date"}, + { + "data": "hold_date", + "render": function(data, type, row, meta) { + return (data&&$date(data))||''; + } + }, { "data": "expiration_date", "render": function(data, type, row, meta) { @@ -191,13 +196,13 @@ table.on('draw.dt', function(event, settings) { var page_info = table.page.info(); - $(".controls .info").html(_("Showing page %s of %s").format(page_info.page+1, page_info.pages)); - if(!page_info.page) { + $(".controls .info").html(page_info.pages?_("Showing page %s of %s").format(page_info.page+1, page_info.pages):''); + if(!page_info.page||!page_info.pages) { $('.controls .previous').addClass('disabled'); } else { $('.controls .previous').removeClass('disabled'); } - if(page_info.pages-1===page_info.page) { + if(page_info.pages-1===page_info.page||!page_info.pages) { $('.controls .next').addClass('disabled'); } else { $('.controls .next').removeClass('disabled'); @@ -226,7 +231,7 @@ }; }; - $(".controls .search").keypress(debounce(function(event) { + $(".controls .search").keyup(debounce(function(event) { table.search(this.value).draw(); }, 300)); }); -- 2.25.0