X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=openstreetmap%2Fopenstreetmap.js;h=a94011daacba53956e623894225bf2f5c3665904;hb=7ab24791667ab0ab1a04d01802e0a3ff47110c24;hp=479e769cf676293a45d1892eccbe0a31c4ad63f3;hpb=02687a98f25b998b4d9ee7cca14d8aa5e5ea491c;p=friendica-addons.git diff --git a/openstreetmap/openstreetmap.js b/openstreetmap/openstreetmap.js index 479e769c..a94011da 100644 --- a/openstreetmap/openstreetmap.js +++ b/openstreetmap/openstreetmap.js @@ -2,8 +2,8 @@ var toolserver = 'http://toolserver.org/~kolossos/openlayers/kml-on-ol.php'; var startTag = ''; +// @TODO document.ready() does not work for ajax loaded content jQuery(document).ready(function($) { - $('.wall-item-content-wrapper').each(function(index) { var link = $(this).find('.wall-item-location .OSMMapLink'); link.toggle(addIframe, removeIframe); @@ -12,14 +12,12 @@ jQuery(document).ready(function($) { function addIframe(ev) { var coordinate = $(ev.target).attr('title'); - var newTag = startTag + convertCoordinateString(coordinate) + endTag; $(ev.target).parents('.wall-item-content-wrapper').append(newTag); } function removeIframe(ev) { $(ev.target).parents('.wall-item-content-wrapper').find('iframe').remove(); - } function convertCoordinateString(coordinate) { @@ -38,4 +36,5 @@ function convertCoordinateString(coordinate) { westEast = '_E'; } return Math.abs(locstring[0]) + northSouth + Math.abs(locstring[1]) + westEast; -} \ No newline at end of file +} +