]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
#69 dude sixty nine
authorDaniel Hodgin <hodgin.daniel@gmail.com>
Thu, 1 Jul 2010 22:49:43 +0000 (18:49 -0400)
committerDaniel Hodgin <hodgin.daniel@gmail.com>
Thu, 1 Jul 2010 22:49:43 +0000 (18:49 -0400)
popcorn.js

index 2adbbf4a74835eaf89f2b6653e4c0c01a7867a26..6ddd9d4c776f6fc8fc51295a746e5623e6aa84f7 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));