[open-ils-commits] r10590 - trunk/Open-ILS/web/opac/skin/default/js

svn at svn.open-ils.org svn at svn.open-ils.org
Sat Sep 13 20:32:30 EDT 2008


Author: dbs
Date: 2008-09-13 20:32:29 -0400 (Sat, 13 Sep 2008)
New Revision: 10590

Modified:
   trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
Log:
Now that we're guaranteeing each URL attribute will be defined,
we no longer need to check for 'undefined'


Modified: trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/rdetail.js	2008-09-13 20:01:32 UTC (rev 10589)
+++ trunk/Open-ILS/web/opac/skin/default/js/rdetail.js	2008-09-14 00:32:29 UTC (rev 10590)
@@ -224,15 +224,15 @@
 			// (as $y was defined later in MARC21's life as the display label)
 			var displayLabel = '' + links[i+1];
 			var note = '' + links[i+2];
-			if(displayLabel == 'undefined' || displayLabel.match(/https?:\/|ftps?:\/|mailto:/i)) {
-				if(note == 'undefined' || note.match(/https?:\/|ftps?:\/|mailto:/i)) {
+			if(!displayLabel || displayLabel.match(/https?:\/|ftps?:\/|mailto:/i)) {
+				if(!note || note.match(/https?:\/|ftps?:\/|mailto:/i)) {
 					displayLabel = href;
 				} else {
 					displayLabel = note;
 				}
 			}
 			$('rdetail_online').appendChild(elem('a', {href:href,'class':'classic_link'}, displayLabel));
-			if (note != 'undefined' && note != displayLabel) {
+			if (!note && note != displayLabel) {
 				$('rdetail_online').appendChild(elem('span', {'class':'url_note'}, ' - ' + note));
 			}
 			$('rdetail_online').appendChild(elem('br'));



More information about the open-ils-commits mailing list