RT24863: Suppress OD API on grouped records (metarecords) in search results
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Thu, 4 Dec 2014 20:16:06 +0000 (12:16 -0800)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Thu, 4 Dec 2014 21:34:02 +0000 (13:34 -0800)
Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
src/od_pages_opac.coffee

index 2c58250..e8d5105 100644 (file)
@@ -68,18 +68,21 @@ define [
                        ids = []
                        for row in @ when id = $(row)._productID()
 
                        ids = []
                        for row in @ when id = $(row)._productID()
 
-                               # Cache the ID so that we don't need to traverse the DOM again
-                               ids.push id
-
-                               # Adorn each row with a product ID
-                               $(row).prop 'id', id
-                               # Add an empty container of format and availability values
-                               .find '.results_info_table > tbody'
-                                       .append result
-                                       .end()
-                               # Set up progress bars
-                               ._results_meta()
-                               ._results_avail()
+                               # skip this row if it is a grouped record (metarecord)
+                               unless $(row).find("abbr.unapi-id[title*='metabib-metarecord']").length > 0
+
+                                       # Cache the ID so that we don't need to traverse the DOM again
+                                       ids.push id
+
+                                       # Adorn each row with a product ID
+                                       $(row).prop 'id', id
+                                       # Add an empty container of format and availability values
+                                       .find '.results_info_table > tbody'
+                                               .append result
+                                               .end()
+                                       # Set up progress bars
+                                       ._results_meta()
+                                       ._results_avail()
 
                        return ids
 
 
                        return ids