From cabb61719d11fcfd6e9ae93b0c0227df8a3c5bdd Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Mon, 29 Feb 2016 18:04:40 -0500 Subject: Open sidebar button on mobile. --- app/assets/javascripts/application.js.coffee | 4 ++-- app/assets/stylesheets/framework/sidebar.scss | 22 +++++++++++++++++++--- app/helpers/issuables_helper.rb | 2 +- app/views/projects/issues/show.html.haml | 3 +++ 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index c17d2186e29..570adc27011 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -225,8 +225,8 @@ $ -> $gutterIcon.closest('a').trigger('click') $(document) - .off 'click', 'aside .gutter-toggle' - .on 'click', 'aside .gutter-toggle', (e) -> + .off 'click', '.gutter-toggle' + .on 'click', '.gutter-toggle', (e) -> e.preventDefault() $this = $(this) $thisIcon = $this.find 'i' diff --git a/app/assets/stylesheets/framework/sidebar.scss b/app/assets/stylesheets/framework/sidebar.scss index de947c89c19..f866151ae0c 100644 --- a/app/assets/stylesheets/framework/sidebar.scss +++ b/app/assets/stylesheets/framework/sidebar.scss @@ -199,7 +199,12 @@ padding-left: $sidebar_width; &.right-sidebar-collapsed { - padding-right: $sidebar_collapsed_width; + @media (max-width: $screen-sm-max) { + padding-right: 0; + } + @media (min-width: $screen-sm-min) { + padding-right: $sidebar_collapsed_width; + } } .sidebar-wrapper { @@ -225,7 +230,12 @@ padding-left: $sidebar_collapsed_width; &.right-sidebar-collapsed { - padding-right: $sidebar_collapsed_width; + @media (max-width: $screen-sm-max) { + padding-right: 0; + } + @media (min-width: $screen-sm-min) { + padding-right: $sidebar_collapsed_width; + } } .sidebar-wrapper { @@ -292,7 +302,13 @@ } .page-sidebar-collapsed { - @include collapsed-sidebar; + @media (max-width: $screen-sm-max) { + @include collapsed-sidebar; + padding-right: 0; + } + @media (min-width: $screen-sm-min) { + @include collapsed-sidebar; + } } .page-sidebar-expanded { diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb index 91a3aa371ef..1d1098c5df4 100644 --- a/app/helpers/issuables_helper.rb +++ b/app/helpers/issuables_helper.rb @@ -5,7 +5,7 @@ module IssuablesHelper end def sidebar_gutter_collapsed_class - "right-sidebar-#{sidebar_gutter_collapsed? ? 'collapsed' : 'expanded'}" + "hidden-xs right-sidebar-#{sidebar_gutter_collapsed? ? 'collapsed' : 'expanded'}" end def issuables_count(issuable) diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml index aa70fdafd97..3e2557e033b 100644 --- a/app/views/projects/issues/show.html.haml +++ b/app/views/projects/issues/show.html.haml @@ -18,6 +18,9 @@ %span.hidden-sm.hidden-md.hidden-lg =icon('circle-o') + %a.btn.btn-default.pull-right.hidden-sm.hidden-md.hidden-lg.gutter-toggle{ href: "#" } + « + .issue-meta %strong.identifier Issue ##{@issue.iid} -- cgit v1.2.1