-<script type="text/javascript">
- function openMapKey() {
- updateMapKey();
-
- openSidebar({
- title: "<%= t('site.key.map_key') %>",
- onclose: closeMapKey
- });
-
- map.events.register("zoomend", map, updateMapKey);
- map.events.register("changelayer", map, updateMapKey);
- }
-
- function closeMapKey() {
- map.events.unregister("zoomend", map, updateMapKey);
- map.events.unregister("changelayer", map, updateMapKey);
- }
-
- function updateMapKey() {
- $("#sidebar_content").load("<%= url_for :action => :key %>", {
- layer: map.baseLayer.keyid,
- zoom: map.getZoom()
- });
- }
-</script>
-
<% content_for :left_menu do %>
- <li><%= link_to_function t('site.key.map_key'), "openMapKey()", :title => t('site.key.map_key_tooltip') %></li>
+ <li><%= link_to t("site.key.map_key"), {:action => :key}, :id => "open_map_key", :title => t("site.key.map_key_tooltip") %></li>
<% end %>