summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorClement Ho <clemmakesapps@gmail.com>2017-07-24 19:01:50 +0000
committerClement Ho <clemmakesapps@gmail.com>2017-07-24 19:01:50 +0000
commitea6dfcad9fdb2c673c1074c6d99ff1cca42d680a (patch)
tree073b023b37f9a15dd5a7e31627800dc9b797a189 /app
parentf39f54c6e6e02d23f59702bbbfc2b43864dc17be (diff)
parent9408ed7f5a3750dcf589c071a008afce9af56dc6 (diff)
downloadgitlab-ce-ea6dfcad9fdb2c673c1074c6d99ff1cca42d680a.tar.gz
Merge branch '35156-more-responsive-nav' into 'master'
fix resize bug for title and collapsible nav menus Closes #35156 See merge request !12904
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/main.js8
-rw-r--r--app/assets/stylesheets/framework/header.scss29
-rw-r--r--app/views/layouts/header/_new.html.haml2
3 files changed, 31 insertions, 8 deletions
diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js
index 44b502cdab3..e96d51de838 100644
--- a/app/assets/javascripts/main.js
+++ b/app/assets/javascripts/main.js
@@ -290,13 +290,7 @@ $(function () {
return $container.remove();
// Commit show suppressed diff
});
- $('.navbar-toggle').on('click', function () {
- $('.header-content .title, .header-content .navbar-sub-nav').toggle();
- $('.header-content .header-logo').toggle();
- $('.header-content .navbar-collapse').toggle();
- $('.js-navbar-toggle-left, .js-navbar-toggle-right, .title-container').toggle();
- return $('.navbar-toggle').toggleClass('active');
- });
+ $('.navbar-toggle').on('click', () => $('.header-content').toggleClass('menu-expanded'));
// Show/hide comments on diff
$body.on('click', '.js-toggle-diff-comments', function (e) {
var $this = $(this);
diff --git a/app/assets/stylesheets/framework/header.scss b/app/assets/stylesheets/framework/header.scss
index 20fb10c28d4..605f4284bb5 100644
--- a/app/assets/stylesheets/framework/header.scss
+++ b/app/assets/stylesheets/framework/header.scss
@@ -132,6 +132,22 @@ header {
}
}
+ &.navbar-gitlab-new {
+ .fa-times {
+ display: none;
+ }
+
+ .menu-expanded {
+ .fa-ellipsis-v {
+ display: none;
+ }
+
+ .fa-times {
+ display: block;
+ }
+ }
+ }
+
.global-dropdown {
position: absolute;
left: -10px;
@@ -171,6 +187,19 @@ header {
min-height: $header-height;
padding-left: 30px;
+ &.menu-expanded {
+ @media (max-width: $screen-xs-max) {
+ .header-logo,
+ .title-container {
+ display: none;
+ }
+
+ .navbar-collapse {
+ display: block;
+ }
+ }
+ }
+
.dropdown-menu {
margin-top: -5px;
}
diff --git a/app/views/layouts/header/_new.html.haml b/app/views/layouts/header/_new.html.haml
index 76367bd9734..60940dba475 100644
--- a/app/views/layouts/header/_new.html.haml
+++ b/app/views/layouts/header/_new.html.haml
@@ -81,6 +81,6 @@
%button.navbar-toggle.hidden-sm.hidden-md.hidden-lg{ type: 'button' }
%span.sr-only Toggle navigation
= icon('ellipsis-v', class: 'js-navbar-toggle-right')
- = icon('times', class: 'js-navbar-toggle-left', style: 'display: none;')
+ = icon('times', class: 'js-navbar-toggle-left')
= render 'shared/outdated_browser'