[open-ils-commits] r13665 - trunk/Open-ILS/web/js/dojo/openils (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Jul 21 11:04:41 EDT 2009
Author: erickson
Date: 2009-07-21 11:04:38 -0400 (Tue, 21 Jul 2009)
New Revision: 13665
Modified:
trunk/Open-ILS/web/js/dojo/openils/BibTemplate.js
Log:
IE does not support Array.map(), use dojo.map(). dojox.data.dom.textContent() returns nothing in IE -- use innerHTML instead when using IE.
Modified: trunk/Open-ILS/web/js/dojo/openils/BibTemplate.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/BibTemplate.js 2009-07-21 14:09:42 UTC (rev 13664)
+++ trunk/Open-ILS/web/js/dojo/openils/BibTemplate.js 2009-07-21 15:04:38 UTC (rev 13665)
@@ -53,14 +53,16 @@
dojo.forEach(slot_list, function (slot) {
var joiner = slot.getAttribute('join') || ' ';
- var slot_handler = dojo.query(
- 'script[type=opac/slot-format]',
- slot
- ).orphan().map(
- function(x){return dojox.data.dom.textContent(x)}
- ).join('');
-
-
+ var slot_handler = dojo.map(
+ dojo.query('script[type=opac/slot-format]', slot).orphan(),
+ function(x){
+ if(dojo.isIE) return x.innerHTML;
+ return dojox.data.dom.textContent(x)
+ }
+ );
+
+ slot_handler = slot_handler.join('');
+
if (slot_handler) slot_handler = new Function('item', slot_handler);
else slot_handler = new Function('item','return dojox.data.dom.textContent(item);');
@@ -69,10 +71,10 @@
bib
);
- if (item_list.length) slot.innerHTML = item_list.map(slot_handler).join(joiner);
-
+ if (item_list.length) slot.innerHTML = dojo.map(item_list, slot_handler).join(joiner);
+
delete(slot_handler);
-
+
});
}
});
More information about the open-ils-commits
mailing list