From 485a87b4bbea061aea8cf6f2d147e2aae9edc9bc Mon Sep 17 00:00:00 2001
From: erickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Wed, 7 Oct 2009 20:23:41 +0000
Subject: [PATCH] created workaround for confusing IE bug caused by titles with
 @'s, which resulted in URLs where the title should be

git-svn-id: svn://svn.open-ils.org/ILS/trunk@14295 dcc99617-32d9-48b4-a31d-7c20da2025e4
---
 Open-ILS/web/opac/common/js/opac_utils.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Open-ILS/web/opac/common/js/opac_utils.js b/Open-ILS/web/opac/common/js/opac_utils.js
index c5965958b2..d587ea10b4 100644
--- a/Open-ILS/web/opac/common/js/opac_utils.js
+++ b/Open-ILS/web/opac/common/js/opac_utils.js
@@ -473,7 +473,9 @@ function buildTitleLink(rec, link) {
 	args[PARAM_OFFSET] = 0;
 	args[PARAM_MRID] = rec.doc_id();
 	args[PARAM_RTYPE] = RTYPE_MRID;
+    var linkText = link.innerHTML; // IE
 	link.setAttribute("href", buildOPACLink(args));
+    link.innerHTML = linkText; // IE
 }
 
 function buildTitleDetailLink(rec, link) {
@@ -481,9 +483,13 @@ function buildTitleDetailLink(rec, link) {
 	link.appendChild(text(normalize(truncate(rec.title(), 65))));
 	var args = {};
 	args.page = RDETAIL;
-	//args[PARAM_OFFSET] = 0;
 	args[PARAM_RID] = rec.doc_id();
+    // in IE, if the link text contains a '@', it replaces the innerHTML text 
+    // with the value of the href attribute.  Wait, what?  Yes.  Capture the
+    // innerHTML and put it back into place after the href is set
+    var linkText = link.innerHTML; // IE
 	link.setAttribute("href", buildOPACLink(args));
+    link.innerHTML = linkText; // IE
 }
 
 /* 'type' is one of STYPE_AUTHOR, STYPE_SUBJECT, ... found in config.js 
-- 
2.11.0