Eliminate loading flash for welcome overlay
This commit is contained in:
parent
e91956d0f7
commit
bd21a1f7ff
5 changed files with 24 additions and 17 deletions
|
@ -198,22 +198,19 @@ $(document).ready(function () {
|
|||
OSM.Index = function(map) {
|
||||
var page = {};
|
||||
|
||||
page.pushstate = function(path) {
|
||||
page.pushstate = function() {
|
||||
$("#content").addClass("overlay-sidebar");
|
||||
map.invalidateSize({pan: false})
|
||||
.panBy([-350, 0], {animate: false});
|
||||
OSM.loadSidebarContent(path);
|
||||
page.load();
|
||||
};
|
||||
|
||||
page.load = function() {
|
||||
return map.getState();
|
||||
};
|
||||
|
||||
page.popstate = function(path) {
|
||||
page.popstate = function() {
|
||||
$("#content").addClass("overlay-sidebar");
|
||||
map.invalidateSize({pan: false});
|
||||
OSM.loadSidebarContent(path);
|
||||
};
|
||||
|
||||
page.unload = function() {
|
||||
|
|
|
@ -649,12 +649,22 @@ nav.secondary {
|
|||
}
|
||||
}
|
||||
|
||||
.welcome {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.overlay-sidebar #sidebar {
|
||||
position: absolute;
|
||||
z-index: 1000;
|
||||
height: auto;
|
||||
border-bottom-right-radius: 5px;
|
||||
overflow: hidden;
|
||||
.welcome {
|
||||
display: block;
|
||||
}
|
||||
#sidebar_content {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.welcome {
|
||||
|
|
|
@ -122,7 +122,7 @@ nav.secondary {
|
|||
}
|
||||
|
||||
#sidebar .welcome {
|
||||
display: none;
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.leaflet-top.leaflet-right {
|
||||
|
|
|
@ -40,6 +40,15 @@
|
|||
<%= render :partial => "layouts/flash" %>
|
||||
<%= yield %>
|
||||
</div>
|
||||
|
||||
<% unless @user %>
|
||||
<div class="welcome">
|
||||
<h2><%= t 'layouts.intro_header' %></h2>
|
||||
<p><%= t 'layouts.intro_text' %></p>
|
||||
<a class="button learn-more" href="<%= about_path %>"><%= t('layouts.learn_more') %></a>
|
||||
<a class="button sign-up" href="<%= user_new_path %>"><%= t('layouts.sign_up') %></a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<noscript>
|
||||
|
|
|
@ -1,13 +1,4 @@
|
|||
<%
|
||||
set_title()
|
||||
content_for(:content_class) { "overlay-sidebar" }
|
||||
set_title()
|
||||
content_for(:content_class) { "overlay-sidebar" }
|
||||
%>
|
||||
|
||||
<% unless @user %>
|
||||
<div class="welcome">
|
||||
<h2><%= t 'layouts.intro_header' %></h2>
|
||||
<p><%= t 'layouts.intro_text' %></p>
|
||||
<a class="button learn-more" href="<%= about_path %>"><%= t('layouts.learn_more') %></a>
|
||||
<a class="button sign-up" href="<%= user_new_path %>"><%= t('layouts.sign_up') %></a>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue