diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2018-04-18 22:18:16 +0300 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2018-04-18 22:18:16 +0300 |
commit | 2cd9542e3c50d4c6cfd33fb2604844b53145621c (patch) | |
tree | 4eed61e1f712d182dcb6892f635fbf3715256388 | |
parent | ed385e4b42bc67d47953d84528d02e1ca65d2103 (diff) |
Fix diff stats sticky bar
-rw-r--r-- | app/assets/stylesheets/pages/diff.scss | 16 | ||||
-rw-r--r-- | app/views/projects/diffs/_diffs.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/diffs/_stats.html.haml | 2 |
3 files changed, 12 insertions, 8 deletions
diff --git a/app/assets/stylesheets/pages/diff.scss b/app/assets/stylesheets/pages/diff.scss index 4304f362401..4ba76fa1512 100644 --- a/app/assets/stylesheets/pages/diff.scss +++ b/app/assets/stylesheets/pages/diff.scss @@ -604,19 +604,23 @@ top: 76px; } - &:not(.is-stuck) .diff-stats-additions-deletions-collapsed { - display: none; - } - &.is-stuck { padding-top: 0; padding-bottom: 0; border-bottom: 1px solid $white-dark; - transform: translateY(16px); + transform: translateY(52px); .diff-stats-additions-deletions-expanded, .inline-parallel-buttons { - display: none; + display: none !important; + } + } + } + + @include media-breakpoint-up(lg) { + &.is-stuck { + .diff-stats-additions-deletions-collapsed { + display: block !important; } } } diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml index ccecff72aa7..14d95855e9b 100644 --- a/app/views/projects/diffs/_diffs.html.haml +++ b/app/views/projects/diffs/_diffs.html.haml @@ -11,7 +11,7 @@ = link_to 'Expand all', url_for(params.merge(expanded: 1, format: nil)), class: 'btn btn-secondary' - if show_whitespace_toggle - if current_controller?(:commit) - = commit_diff_whitespace_link(diffs.project, @commit, class: 'd-none d-sm-block') + = commit_diff_whitespace_link(diffs.project, @commit, class: 'd-none d-sm-inline-block') - elsif current_controller?('projects/merge_requests/diffs') = diff_merge_request_whitespace_link(diffs.project, @merge_request, class: 'd-none d-sm-block') - elsif current_controller?(:compare) diff --git a/app/views/projects/diffs/_stats.html.haml b/app/views/projects/diffs/_stats.html.haml index 637ea62200b..50cdc0c48c8 100644 --- a/app/views/projects/diffs/_stats.html.haml +++ b/app/views/projects/diffs/_stats.html.haml @@ -10,7 +10,7 @@ %strong.cgreen= pluralize(sum_added_lines, 'addition') and %strong.cred= pluralize(sum_removed_lines, 'deletion') - .diff-stats-additions-deletions-collapsed.float-right.d-none.d-sm-none.d-md-block{ "aria-hidden": "true", "aria-describedby": "diff-stats" } + .diff-stats-additions-deletions-collapsed.float-right.d-none.d-sm-none{ "aria-hidden": "true", "aria-describedby": "diff-stats" } %strong.cgreen< +#{sum_added_lines} %strong.cred< |