place permalink "under" popup
authorarno <arenevier@fdn.fr>
Tue, 21 Jul 2009 22:35:58 +0000 (00:35 +0200)
committerarno <arenevier@fdn.fr>
Wed, 22 Jul 2009 12:00:38 +0000 (14:00 +0200)
js/syp.js

index 7e69fb75ae61b6b930101cdfce0fdf535a07aabd..e350d88af3ea303dbe1aeeae820351ff8d6fdc5f 100644 (file)
--- a/js/syp.js
+++ b/js/syp.js
@@ -131,6 +131,11 @@ var SYP = {
     },
 
     onFeatureUnselect: function (feature) {
+        var map = feature.layer.map;
+        var permaControl = map.getControlsByClass("OpenLayers.Control.Permalink");
+        if (permaControl[0]) {
+            permaControl[0].div.style.display = "";
+        }
         var popup = feature.popup;
         if (popup.visible()) {
             popup.hide();
@@ -139,6 +144,10 @@ var SYP = {
 
     onFeatureSelect: function(feature) {
         var map = feature.layer.map;
+        var permaControl = map.getControlsByClass("OpenLayers.Control.Permalink");
+        if (permaControl[0]) {
+            permaControl[0].div.style.display = "none";
+        }
         var popup = feature.popup;
 
         var brCorner = SYP.Utils.brCorner(map, 8);