]> git.openstreetmap.org Git - rails.git/commitdiff
Only show "Report a problem" link at zoom level 12 and higher
authorKai Krueger <kakrueger@gmail.com>
Sat, 30 Apr 2011 01:55:29 +0000 (19:55 -0600)
committerKai Krueger <kakrueger@gmail.com>
Sat, 30 Apr 2011 01:55:29 +0000 (19:55 -0600)
app/views/site/index.html.erb

index 27ecf1fa79d6bb7ab610fe5fe11af5b88f300c34..5d78b23407a477e84977a0f722723e85d4b83bbd 100644 (file)
@@ -25,7 +25,7 @@
 <div id="permalink">
   <a href="/" id="permalinkanchor"><%= t 'site.index.permalink' %></a><br/>
   <a href="/" id="shortlinkanchor"><%= t 'site.index.shortlink' %></a><br/>
 <div id="permalink">
   <a href="/" id="permalinkanchor"><%= t 'site.index.permalink' %></a><br/>
   <a href="/" id="shortlinkanchor"><%= t 'site.index.shortlink' %></a><br/>
-  <a href="javascript:void();" id="ReportBug">Report a problem</a>     
+  <a href="javascript:void();" id="ReportBug" class="reportProblem">Report a problem</a>       
 </div>
 
 <div id="attribution">
 </div>
 
 <div id="attribution">
@@ -163,6 +163,9 @@ end
       lBug.addEventListener('click',function (e) {
                map.osbControl.activate(); document.getElementById("OpenLayers.Map_18_OpenLayers_Container").style.cursor = "crosshair" },false);
 
       lBug.addEventListener('click',function (e) {
                map.osbControl.activate(); document.getElementById("OpenLayers.Map_18_OpenLayers_Container").style.cursor = "crosshair" },false);
 
+     map.events.register("zoomend",map,function () { var zoom = map.getZoom(); var lBug = document.getElementById('ReportBug')
+        if (zoom > 11) { lBug.style.visibility = 'visible';} else {lBug.style.visibility = "hidden";}});
+
 
     <% end %>
 
 
     <% end %>