From: Anna Sobiepanek Date: Thu, 1 Jul 2010 23:06:11 +0000 (-0400) Subject: #69 added dhodgin's fix X-Git-Tag: v0.1~48 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=ad50de1cf57092a3fa808671cd611d8cc3fe5156;p=popcorn-js.git #69 added dhodgin's fix --- diff --git a/popcorn.js b/popcorn.js index 6c122d5..7b76705 100644 --- a/popcorn.js +++ b/popcorn.js @@ -417,11 +417,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));