From bba0c7c0d3890bc261ff54b2e7819831f8f88001 Mon Sep 17 00:00:00 2001 From: senator Date: Fri, 3 Dec 2010 19:40:47 +0000 Subject: [PATCH] BibTemplate: make a couple of IE-friendly changes to BibTemplate. git-svn-id: svn://svn.open-ils.org/ILS/trunk@18912 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/dojo/openils/BibTemplate.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/BibTemplate.js b/Open-ILS/web/js/dojo/openils/BibTemplate.js index 4493941313..a72ec16ebc 100644 --- a/Open-ILS/web/js/dojo/openils/BibTemplate.js +++ b/Open-ILS/web/js/dojo/openils/BibTemplate.js @@ -60,8 +60,8 @@ if(!dojo._hasResource["openils.BibTemplate"]) { textContent : function (node) { if (node) { - if (node instanceof HTMLElement) return node.innerText || node.textContent; - return dojox.xml.parser.textContent(node); + return node.innerText || node.textContent || + dojox.xml.parser.textContent(node) || ""; } return ''; }, @@ -153,7 +153,15 @@ if(!dojo._hasResource["openils.BibTemplate"]) { }); if (debug) alert('BibTemplate debug -- template values:\n' + dojo.toJson( template_values )); - if (template_value_count > 0) slot.innerHTML = dojo.string.substitute( unescape(slot.innerHTML), template_values ); + if (template_value_count > 0) { + dojo.attr( + slot, "innerHTML", + dojo.string.substitute( + unescape(slot.innerHTML), + template_values + ) + ); + } } var handler_node = dojo.query( '*[type="opac/slot-format"]', slot )[0]; @@ -165,7 +173,7 @@ if(!dojo._hasResource["openils.BibTemplate"]) { if (templated) { if (handler_node) handler_node.parentNode.replaceChild( dojo.doc.createTextNode( content ), handler_node ); } else { - slot.innerHTML = content; + dojo.attr(slot, "innerHTML", content); } } -- 2.11.0