Now that we're guaranteeing each URL attribute will be defined,
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 14 Sep 2008 00:32:29 +0000 (00:32 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 14 Sep 2008 00:32:29 +0000 (00:32 +0000)
we no longer need to check for 'undefined'

git-svn-id: svn://svn.open-ils.org/ILS/trunk@10590 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/skin/default/js/rdetail.js

index 015caac..b103dc3 100644 (file)
@@ -224,15 +224,15 @@ function _rdetailDraw(r) {
                        // (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'));