Authority popups are empty: fix dojo.query() usage
authorDan Scott <dscott@laurentian.ca>
Tue, 9 Oct 2012 20:49:09 +0000 (16:49 -0400)
committerDan Scott <dscott@laurentian.ca>
Tue, 9 Oct 2012 20:55:47 +0000 (16:55 -0400)
When you right-click on a controllable field to display the contents of
the matching authority records, the contents of the matching authority
records simply appear as empty grey boxes.

This is another case of needing to iterate over multiple values
separately rather than using one convenient CSS selector.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/xul/staff_client/server/cat/marcedit.js

index 6abd005..39fcca5 100644 (file)
@@ -1853,7 +1853,13 @@ function buildAuthorityPopup (entry_text, record, auth_org, auth_id, sf_popup, t
     }
     submenu.appendChild(popup);
 
-    dojo.query('datafield[tag^="1"], datafield[tag^="4"], datafield[tag^="5"]', record).forEach(function(field) {
+    dojo.query('datafield[tag^="1"]', record).forEach(function(field) {
+        buildAuthorityPopupSelector(field, grid, auth_org, auth_id);
+    });
+    dojo.query('datafield[tag^="4"]', record).forEach(function(field) {
+        buildAuthorityPopupSelector(field, grid, auth_org, auth_id);
+    });
+    dojo.query('datafield[tag^="5"]', record).forEach(function(field) {
         buildAuthorityPopupSelector(field, grid, auth_org, auth_id);
     });