From: Daniel Hodgin Date: Thu, 1 Jul 2010 22:49:43 +0000 (-0400) Subject: #69 dude sixty nine X-Git-Tag: v0.1~41^2~7 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=a0939c56d5b8f7428228f48f610d279ddd6659b2;p=popcorn-js.git #69 dude sixty nine --- diff --git a/popcorn.js b/popcorn.js index 2adbbf4..6ddd9d4 100644 --- a/popcorn.js +++ b/popcorn.js @@ -410,11 +410,13 @@ 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));