Include layers in all geolinks except edit

This commit is contained in:
John Firebaugh 2013-11-08 13:51:44 -08:00
parent 8b5e0d0248
commit a2dfc00f27
2 changed files with 7 additions and 6 deletions

View file

@ -63,9 +63,10 @@ function remoteEditHandler(bbox, select) {
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;
@ -76,7 +77,7 @@ function updatelinks(loc, zoom, layers, object) {
zoom: zoom
};
if (layers && $(link).hasClass("layers")) {
if (layers && !editlink) {
args.layers = layers;
}

View file

@ -1,6 +1,6 @@
<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>
@ -9,7 +9,7 @@
<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>
@ -19,7 +19,7 @@
<%= 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>