]> dev.renevier.net Git - syj.git/blobdiff - public/js/syj.js
fixes: termsofuse were sometimes not displayed
[syj.git] / public / js / syj.js
index 9114646b43aed316cfdc3970f97270f1307ac614..3c4bece6a7767b2a093c145ef80a6b9e42ecc53a 100644 (file)
@@ -227,10 +227,8 @@ var SYJView = {
 
         layerOptions = {format:     OpenLayers.Format.WKT,
                         projection: WGS84,
-                        styleMap:   styleMap.view};
-        if (gLoggedInfo.creatorname) {
-            layerOptions.attribution = SyjStrings.routeBy + ' ' + '<strong>' + gLoggedInfo.creatorname + '</strong>';
-        }
+                        styleMap:   styleMap.view,
+                        attribution: SyjStrings.geomAttribution };
 
         this.viewLayer = new OpenLayers.Layer.Vector("View Layer", layerOptions);
         this.map.addLayers([baseLayer, this.viewLayer]);
@@ -599,13 +597,15 @@ var SYJUserClass = Class.create(SYJModalClass, {
 
         $$("#user_termsofuse_anchor, #geom_termsofuse_anchor").invoke('observe', "click", function(evt) {
             if (!this.toubox) {
-                $("termsofusearea").show();
-                $("termsofuseiframe").setAttribute("src", evt.target.href);
                 this.toubox = new SimpleBox($("termsofusearea"), {
                     closeMethods: ["onescapekey", "onouterclick", "onbutton"]
                 });
             }
             this.toubox.show();
+            if (!$("termsofuseiframe").getAttribute("src")) {
+                $("termsofusearea").show();
+                $("termsofuseiframe").setAttribute("src", evt.target.href);
+            }
             evt.stop();
         }.bindAsEventListener(this));