From 5bf278298b5e2ec1c1c65147004dd1c5eafee743 Mon Sep 17 00:00:00 2001 From: zmagod Date: Wed, 5 Oct 2016 12:22:27 +0200 Subject: [PATCH] fixed navbar on sceens smaller than 1000px --- app/assets/stylesheets/extend/bootstrap.scss | 43 +++++++ app/views/shared/_navigation.html.erb | 126 +++++++++---------- 2 files changed, 105 insertions(+), 64 deletions(-) diff --git a/app/assets/stylesheets/extend/bootstrap.scss b/app/assets/stylesheets/extend/bootstrap.scss index 4159a13b1..f65cd2ee8 100644 --- a/app/assets/stylesheets/extend/bootstrap.scss +++ b/app/assets/stylesheets/extend/bootstrap.scss @@ -57,3 +57,46 @@ .result-comment .col-xs-12 { float: none; } + +@media (max-width: 1000px) { + .navbar-header { + float: none; + } + .navbar-left,.navbar-right { + float: none !important; + } + .navbar-toggle { + display: block; + background-color: transparent; + background-image: none; + border: 1px solid transparent; + } + .navbar-collapse { + border-top: 1px solid transparent; + box-shadow: inset 0 1px 0 rgba(255,255,255,0.1); + } + .navbar-fixed-top { + top: 0; + border-width: 0 0 1px; + } + .navbar-collapse.collapse { + display: none!important; + } + .navbar-nav { + float: none!important; + margin-top: 7.5px; + } + .navbar-nav>li { + float: none; + } + .navbar-nav>li>a { + padding-bottom: 10px; + padding-top: 10px; + } + .collapse.in{ + display:block !important; + } + .container { + width: 100%; + } +} diff --git a/app/views/shared/_navigation.html.erb b/app/views/shared/_navigation.html.erb index e00830dc6..325b9294f 100644 --- a/app/views/shared/_navigation.html.erb +++ b/app/views/shared/_navigation.html.erb @@ -28,95 +28,93 @@
  • - <%= t('nav.label.projects') %> + <%= t('nav.label.projects') %>
  • - <%= t('nav.label.protocols') %> + <%= t('nav.label.protocols') %>
  • <% if false %>
  • - <%= t('nav.label.calendar') %> + <%= t('nav.label.calendar') %>
  • <% end %>
  • - <%= t('nav.label.activities') %> + <%= t('nav.label.activities') %>
  • -
    - - - - <%= form_tag search_path, method: :get, id: 'search-bar', class: 'navbar-form navbar-right', role: 'search' do %> -
    -
    - - - - -
    + + <%= form_tag search_path, method: :get, id: 'search-bar', class: 'navbar-form navbar-right', role: 'search' do %> +
    +
    + + + +
    - <% end %> -
    +
    + <% end %>
    <% end %>