[open-ils-commits] r19455 - trunk/Open-ILS/web/js/dojo/openils (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Feb 16 17:20:59 EST 2011


Author: miker
Date: 2011-02-16 17:20:53 -0500 (Wed, 16 Feb 2011)
New Revision: 19455

Modified:
   trunk/Open-ILS/web/js/dojo/openils/BibTemplate.js
Log:
Patch based on work by Dan Wells to improve Opera BibTemplate support

Modified: trunk/Open-ILS/web/js/dojo/openils/BibTemplate.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/BibTemplate.js	2011-02-16 20:49:17 UTC (rev 19454)
+++ trunk/Open-ILS/web/js/dojo/openils/BibTemplate.js	2011-02-16 22:20:53 UTC (rev 19455)
@@ -112,9 +112,15 @@
                                     try { (new Function( 'BT', 'slotXML', 'slot', unescape(cb.innerHTML) ))(BT,bib,slot) } catch (e) {/*meh*/}
                                 });
 
+                                var query = slot.getAttribute('query');
+                                var xml_root = bib.documentElement || bib;
+
+                                // Opera (as of 11.01) fails with quotes in queries
+                                if (dojo.isOpera) query = query.replace(/"|'/g, '');
+
                                 var item_list = dojo.query(
-                                    slot.getAttribute('query'),
-                                    bib
+                                    query,
+                                    xml_root // Make Opera work by querying from the root element
                                 );
 
                                 if (item_limit) {



More information about the open-ils-commits mailing list