From 876d9408fe27bf6cb8d54befa608f1b0a5c0d0bd Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Sun, 6 Mar 2016 00:58:45 +0100 Subject: [PATCH] Fix main menu on small devices (Fixes #2005) Use bootstraps navbar-toggle button to bring up a vertical responsive main menu. Some additional responsive CSS impmprovements. --- openslides/core/static/css/app.css | 55 ++++++++------------- openslides/core/static/js/core/site.js | 4 ++ openslides/core/static/templates/index.html | 46 +++++++++-------- 3 files changed, 50 insertions(+), 55 deletions(-) diff --git a/openslides/core/static/css/app.css b/openslides/core/static/css/app.css index ba033752f..accc49747 100644 --- a/openslides/core/static/css/app.css +++ b/openslides/core/static/css/app.css @@ -143,30 +143,30 @@ img { } #nav .navbar { + width: 100%; float: left; border: none; margin: 0; } -#nav .navbar .button { - float: left; - display: none; +#nav .navbar-toggle { + padding: 5px 0; } -#nav .navbar .button i { - padding-top: 33px; +#nav .navbar-toggle i { font-size: 28px; + color: #fff; opacity: 0.5; } -#nav .navbar .button a i { - display: block; - color: #fff; -} -#nav .navbar .button a:hover i { +#nav .navbar-toggle:hover i { opacity: 1; } +#nav .navbar-collapse { + padding: 0; +} + #nav .navbar ul { list-style: none; margin: 0; @@ -752,12 +752,13 @@ img { box-shadow: -5px 5px 5px rgba(0, 0, 0, 0.2); height: 200px; padding: 0 10px 10px 10px; - z-index: 99; + z-index: 1; } #chatbox-text { overflow-y: scroll; height: 190px; + color: #222; } /* tables */ @@ -809,7 +810,6 @@ tr.selected td { body { font-size: 12px;} - h1 { font-size: 30px; padding-bottom: 6px; } h2 { font-size: 22px; padding-bottom: 10px; } @@ -819,43 +819,30 @@ tr.selected td { } - /* display for resolutions smaller that 900px */ @media only screen and (max-width: 900px) { #nav .navbar li a { padding: 24px 5px; } } + /* display for resolutions smaller that 760px */ @media only screen and (max-width: 760px) { - #nav .navbar li a { padding: 24px 2px; } - #nav .searchbar input { width: 100px; } -} - - -/* display for resolutions smaller that 480px */ -@media only screen and (max-width: 480px) { - h1 { font-size: 22px; padding-bottom: 4px; } h2 { font-size: 16px; padding-bottom: 4px; } h3 { font-size: 14px; padding-bottom: 4px; } - #header { height: 80px; } - #header .title { width: 100%; text-align: center; margin-top: 5px; } - #header .user { float: left; width: 100%; } + .user i { font-size: 16px; padding: 3px; } - #nav { height: 60px; } - #nav .navbar ul { display:none;} - #nav .navbar .button { display: block;} - #nav .navbar .button i { padding-top: 15px;} - #nav .searchbar { margin-top: 15px; } - #nav .searchbar input { width: 150px; } + #nav .navbar { box-shadow: none; } + #nav .navbar ul li a { padding: 10px 15px; } + #nav .searchbar { margin: 15px 0; } - #chatbox { width: 100%; top: 130px; } - .optional { /* hide optional column */ - display: none; - } + #chatbox { width: 100%; top: 40px; } + + /* hide marked element / column */ + .optional, .hide-sm { display: none; } } diff --git a/openslides/core/static/js/core/site.js b/openslides/core/static/js/core/site.js index 53be79942..e87b45de4 100644 --- a/openslides/core/static/js/core/site.js +++ b/openslides/core/static/js/core/site.js @@ -437,6 +437,10 @@ angular.module('OpenSlidesApp.core.site', [ 'mainMenu', function ($scope, mainMenu) { mainMenu.registerScope($scope); + $scope.isMenuOpen = false; + $scope.closeMenu = function () { + $scope.isMenuOpen = false; + }; } ]) diff --git a/openslides/core/static/templates/index.html b/openslides/core/static/templates/index.html index 46c5ddff8..f771fa36c 100644 --- a/openslides/core/static/templates/index.html +++ b/openslides/core/static/templates/index.html @@ -34,7 +34,7 @@ - Chat + Chat {{ unreadMessages }} @@ -72,7 +72,7 @@ - {{ operator.user.get_short_name() }} + {{ operator.user.get_short_name() }}