]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
#69 added dhodgin's fix
authorAnna Sobiepanek <annaopensource@gmail.com>
Thu, 1 Jul 2010 23:06:11 +0000 (19:06 -0400)
committerAnna Sobiepanek <annaopensource@gmail.com>
Thu, 1 Jul 2010 23:06:11 +0000 (19:06 -0400)
popcorn.js

index 6c122d52907629ef190612ee16902367bf31abc2..7b767056c4cd3b2f55ffcaab73bfe9075a777eac 100644 (file)
     this.onIn = function() {
       MapCommand.map.setCenter(this.location);
       MapCommand.map.setZoom(this.params.zoom);
-      var link = document.createElement("a");
-      link.setAttribute("href", this.params.src);
-      link.setAttribute("target", "_new");
-      link.appendChild(document.createTextNode(this.params.description));
-      document.getElementById('mapinfo').appendChild(link);
+      if (this.params.src) {
+        var link = document.createElement("a");
+        link.setAttribute("href", this.params.src);
+        link.setAttribute("target", "_new");
+        link.appendChild(document.createTextNode(this.params.description||this.params.src));
+        document.getElementById('mapinfo').appendChild(link);
+      }
     };
     this.onOut = function() {
       MapCommand.map.setCenter(new google.maps.LatLng(0, 0));