From: Eden Halperin Date: Wed, 6 Nov 2013 17:57:01 +0000 (-0500) Subject: responsive secondary pages and fixed map X-Git-Tag: live~4653^2~183 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/537d72b0f66562475808249a1a2ef3223df5dd52 responsive secondary pages and fixed map --- diff --git a/app/assets/images/menu-icon.png b/app/assets/images/menu-icon.png new file mode 100644 index 000000000..da3f92c5d Binary files /dev/null and b/app/assets/images/menu-icon.png differ diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index e244d8b30..cecceaf35 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -130,4 +130,8 @@ function minimiseMap() { $(document).ready(function () { var auth_token = $("meta[name=csrf-token]").attr("content"); $("form input[name=authenticity_token]").val(auth_token); + + $("#menu-icon").on("click", function() { + $("header").toggleClass("closed"); + }); }); diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 2f644e00a..c6295cb10 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -309,7 +309,4 @@ $(document).ready(function () { map.getCenter().lng.toFixed(precision))); }); - $("#menu-icon").on("click", function() { - $("header").toggleClass("closed"); - }); }); diff --git a/app/assets/stylesheets/common.css.scss b/app/assets/stylesheets/common.css.scss index 46f679955..ca65a1b3d 100644 --- a/app/assets/stylesheets/common.css.scss +++ b/app/assets/stylesheets/common.css.scss @@ -239,7 +239,14 @@ table { #menu-icon { display: none; - float: right; + float: right; + background: url("/assets/menu-icon.png") no-repeat; + background-size: 30px 30px; + display: block; + width: 30px; + height: 30px; + margin: 14px 10px 0 0; + opacity: 0.6; } header { diff --git a/app/assets/stylesheets/small.css.scss b/app/assets/stylesheets/small.css.scss index fb35aa6ac..a92bf4ac5 100644 --- a/app/assets/stylesheets/small.css.scss +++ b/app/assets/stylesheets/small.css.scss @@ -25,10 +25,14 @@ nav.secondary { header { min-height: 54px; - height: 100%; + height: auto; background: #fff; + border-bottom: 1px solid #ddd; clear: both; - h1 { padding-bottom: 17px; } + position: fixed; + width: 100%; + top: 0; + h1 { padding-bottom: 15px; } &.closed { nav.primary, nav.secondary { @@ -66,20 +70,55 @@ nav.secondary { display: block; width: 100%; margin-left: 0; + > li { + width: 49%; + > a { + width: 100%; + text-align: center; + } + } } } +#content { margin-top: 58px; } + .map-layout { #sidebar { - width: 60%; + width: 100%; + position: fixed; + top: 58px; + height: 360px; + overflow-x: hidden; + z-index: 1; + background: #fff; + p.large-text { + font-size: 1.4em; + line-height: 1.5em; + } + &.minimized { + background: none; + } } #content { - position: static; + position: fixed; + top: 0; display: block; - height: 600px; + height: 100%; + margin-top: 0; + padding-top: 58px; + } + #map { + width: 100%; + // height: 100%; + // position: fixed; } } +.leaflet-top.leaflet-right { + top: 10px !important; + z-index: 0; +} + .content_map { width: 100%; border: none; @@ -161,3 +200,7 @@ nav.secondary { display: none; } } + +.site-about #content .attr h1 { + font-size: 28px; +} diff --git a/app/views/geocoder/search.html.erb b/app/views/geocoder/search.html.erb index 42a1a306e..e142d00b8 100644 --- a/app/views/geocoder/search.html.erb +++ b/app/views/geocoder/search.html.erb @@ -1,4 +1,7 @@ -

<%= t('site.sidebar.search_results') %>

+

+ <%= t('site.sidebar.search_results') %> + +

<% @sources.each do |source| %>

<%= raw(t "geocoder.search.title.#{source}") %>

"> diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index b4dc5db6a..316349664 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -1,11 +1,11 @@ -
+

<%= image_tag "osm_logo.png", :alt => t('layouts.logo.alt_text'), :class => 'logo' %> <%= t 'layouts.project_name.h1' %>

- menu +