RT24863: Suppress OD API on grouped records (metarecords) in search results
[sitka/overdrive-evergreen-opac.git] / src / od_pages_opac.coffee
index 2c58250..e8d5105 100644 (file)
@@ -68,18 +68,21 @@ define [
                        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