Bug 17602: Handle '60+' if there are more than 60 results

The service returns "60+" if there are more than 60 results.
Without this patch the "Found %s results in RecordedBooks collection"
line is removed.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2017-11-08 10:06:49 -03:00 committed by Nick Clemens
parent 7ff2b8d5e2
commit 48c0e8952a

View file

@ -913,7 +913,8 @@ $(document).ready(function(){
return;
}
if ( data.total > 0 ) {
// data.total can be either 42 or "60+"
if ( typeof(data.total) === 'string' && data.total.charAt(0) > 0 || typeof(data.total) === 'number' && data.total > 0 ) {
$recordedbooks_results.html( _( "Found %s results in RecordedBooks collection" ).format('<a href="/cgi-bin/koha/opac-recordedbooks-search.pl?q=' + escape( querystring ) + '">' + data.total + '</a>') );
} else {
$recordedbooks_results.remove();