added search limit sanity check
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 29 Jun 2006 21:51:19 +0000 (21:51 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 29 Jun 2006 21:51:19 +0000 (21:51 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@4858 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/skin/default/js/result_common.js

index 488eb7c..5075dfa 100644 (file)
@@ -56,8 +56,11 @@ function resultCollectSearchIds( type, method, handler ) {
        }
 
        var limit = (resultFetchAllRecords) ? 1000 : getDisplayCount();
-       if( getHitCount() > 0 && (getOffset() + getDisplayCount()) > getHitCount() ) 
-               limit = getHitCount() - getOffset();
+
+       if( getOffset() > 0 ) {
+               if( getHitCount() > 0 && (getOffset() + getDisplayCount()) > getHitCount() ) 
+                       limit = getHitCount() - getOffset();
+       }
 
        args.org_unit = getLocation();
        args.depth    = getDepth();