function updatelinks(loc, zoom, layers, object) {
$(".geolink").each(function(index, link) {
var href = link.href.split(/[?#]/)[0],
- args = querystring.parse(link.search.substring(1));
+ args = querystring.parse(link.search.substring(1)),
+ editlink = $(link).hasClass("editlink");
- if (object && $(link).hasClass("object")) args[object.type] = object.id;
+ if (object && editlink) args[object.type] = object.id;
var query = querystring.stringify(args);
if (query) href += '?' + query;
zoom: zoom
};
- if (layers && $(link).hasClass("layers")) {
+ if (layers && !editlink) {
args.layers = layers;
}
<header class="closed">
<h1>
- <a href="<%= root_path %>" class="geolink layers">
+ <a href="<%= root_path %>" class="geolink">
<%= image_tag "osm_logo.png", :alt => t('layouts.logo.alt_text'), :class => 'logo' %>
<%= t 'layouts.project_name.h1' %>
</a>
<nav class='primary'>
<ul>
<li id="edit_tab" class="dropdown <%= current_page_class(edit_path) %>">
- <%= link_to t('layouts.edit'), edit_path, :class => "tab geolink object",
+ <%= link_to t('layouts.edit'), edit_path, :class => "tab geolink editlink",
:id => 'editanchor',
:data => { :editor => preferred_editor }
%><a class='dropdown-toggle' data-toggle='dropdown' href='#'><b class="caret"></b></a>
<%= link_to t('layouts.edit_with', :editor => t("editor.#{editor}.description")),
edit_path(:editor => editor),
:data => { :editor => editor },
- :class => "geolink object" %>
+ :class => "geolink editlink" %>
</li>
<% end %>
</ul>