Test for NaN-ness of hit count and index
authorMike Rylander <mrylander@gmail.com>
Wed, 24 Feb 2016 17:53:15 +0000 (12:53 -0500)
committerMike Rylander <mrylander@gmail.com>
Wed, 24 Feb 2016 17:53:15 +0000 (12:53 -0500)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/js/ui/default/staff/cat/catalog/app.js

index 3a6b708..e2540b6 100644 (file)
@@ -248,20 +248,22 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
     $scope.opac_iframe = null;
     $scope.parts_iframe = null;
 
-    $scope.search_result_index = 0;
-    $scope.search_result_hit_count = 0;
+    $scope.search_result_index = 1;
+    $scope.search_result_hit_count = 1;
 
     $scope.$watch(
         'opac_iframe.dom.contentWindow.search_result_index',
         function (n,o) {
-            $scope.search_result_index = n + 1;
+            if (!isNaN(parseInt(n)))
+                $scope.search_result_index = n + 1;
         }
     );
 
     $scope.$watch(
         'opac_iframe.dom.contentWindow.search_result_hit_count',
         function (n,o) {
-            $scope.search_result_hit_count = n;
+            if (!isNaN(parseInt(n)))
+                $scope.search_result_hit_count = n;
         }
     );