Commit 598973c3 authored by Phil Hughes's avatar Phil Hughes

Fixed inner page tabs not being scrollable

Some inner page tabs where not scrollable like the top nav & this caused
them to break onto new lines mobile.

This pages include:

- dashboard/projects
- project -> merge_requests
- search
- project -> milestones
- project -> pipelines

Closes #18853
parent ad831ace
...@@ -17,52 +17,56 @@ export default { ...@@ -17,52 +17,56 @@ export default {
}, },
template: ` template: `
<ul class="nav-links"> <div class="scrolling-tabs-container">
<li <div class="fade-left"><i class="fa fa-angle-left"></i></div>
class="js-pipelines-tab-all" <div class="fade-right"><i class="fa fa-angle-right"></i></div>
:class="{ 'active': scope === 'all'}"> <ul class="nav-links scrolling-tabs">
<a :href="paths.allPath"> <li
All class="js-pipelines-tab-all"
<span class="badge js-totalbuilds-count"> :class="{ 'active': scope === 'all'}">
{{count.all}} <a :href="paths.allPath">
</span> All
</a> <span class="badge js-totalbuilds-count">
</li> {{count.all}}
<li class="js-pipelines-tab-pending" </span>
:class="{ 'active': scope === 'pending'}"> </a>
<a :href="paths.pendingPath"> </li>
Pending <li class="js-pipelines-tab-pending"
<span class="badge"> :class="{ 'active': scope === 'pending'}">
{{count.pending}} <a :href="paths.pendingPath">
</span> Pending
</a> <span class="badge">
</li> {{count.pending}}
<li class="js-pipelines-tab-running" </span>
:class="{ 'active': scope === 'running'}"> </a>
<a :href="paths.runningPath"> </li>
Running <li class="js-pipelines-tab-running"
<span class="badge"> :class="{ 'active': scope === 'running'}">
{{count.running}} <a :href="paths.runningPath">
</span> Running
</a> <span class="badge">
</li> {{count.running}}
<li class="js-pipelines-tab-finished" </span>
:class="{ 'active': scope === 'finished'}"> </a>
<a :href="paths.finishedPath"> </li>
Finished <li class="js-pipelines-tab-finished"
<span class="badge"> :class="{ 'active': scope === 'finished'}">
{{count.finished}} <a :href="paths.finishedPath">
</span> Finished
</a> <span class="badge">
</li> {{count.finished}}
<li class="js-pipelines-tab-branches" </span>
:class="{ 'active': scope === 'branches'}"> </a>
<a :href="paths.branchesPath">Branches</a> </li>
</li> <li class="js-pipelines-tab-branches"
<li class="js-pipelines-tab-tags" :class="{ 'active': scope === 'branches'}">
:class="{ 'active': scope === 'tags'}"> <a :href="paths.branchesPath">Branches</a>
<a :href="paths.tagsPath">Tags</a> </li>
</li> <li class="js-pipelines-tab-tags"
</ul> :class="{ 'active': scope === 'tags'}">
<a :href="paths.tagsPath">Tags</a>
</li>
</ul>
</div>
`, `,
}; };
...@@ -476,3 +476,27 @@ ...@@ -476,3 +476,27 @@
} }
} }
} }
.inner-page-scroll-tabs {
position: relative;
.fade-right {
@include fade(left, $white-light);
right: 0;
text-align: right;
.fa {
right: 5px;
}
}
.fade-left {
@include fade(right, $white-light);
left: 0;
text-align: left;
.fa {
left: 5px;
}
}
}
= content_for :flash_message do = content_for :flash_message do
= render 'shared/project_limit' = render 'shared/project_limit'
.top-area .top-area.scrolling-tabs-container
%ul.nav-links .inner-page-scroll-tabs
= nav_link(page: [dashboard_projects_path, root_path]) do .fade-left= icon('angle-left')
= link_to dashboard_projects_path, title: 'Home', class: 'shortcuts-activity', data: {placement: 'right'} do .fade-right= icon('angle-right')
Your projects %ul.nav-links.scrolling-tabs
= nav_link(page: starred_dashboard_projects_path) do = nav_link(page: [dashboard_projects_path, root_path]) do
= link_to starred_dashboard_projects_path, title: 'Starred Projects', data: {placement: 'right'} do = link_to dashboard_projects_path, title: 'Home', class: 'shortcuts-activity', data: {placement: 'right'} do
Starred projects Your projects
= nav_link(page: [explore_root_path, trending_explore_projects_path, starred_explore_projects_path, explore_projects_path]) do = nav_link(page: starred_dashboard_projects_path) do
= link_to explore_root_path, title: 'Explore', data: {placement: 'right'} do = link_to starred_dashboard_projects_path, title: 'Starred Projects', data: {placement: 'right'} do
Explore projects Starred projects
= nav_link(page: [explore_root_path, trending_explore_projects_path, starred_explore_projects_path, explore_projects_path]) do
= link_to explore_root_path, title: 'Explore', data: {placement: 'right'} do
Explore projects
.nav-controls .nav-controls
= render 'shared/projects/search_form' = render 'shared/projects/search_form'
......
...@@ -52,8 +52,10 @@ ...@@ -52,8 +52,10 @@
= render 'award_emoji/awards_block', awardable: @merge_request, inline: true = render 'award_emoji/awards_block', awardable: @merge_request, inline: true
.merge-request-tabs-holder{ class: ("js-tabs-affix" unless ENV['RAILS_ENV'] == 'test') } .merge-request-tabs-holder{ class: ("js-tabs-affix" unless ENV['RAILS_ENV'] == 'test') }
.merge-request-tabs-container .merge-request-tabs-container.scrolling-tabs-container.inner-page-scroll-tabs
%ul.merge-request-tabs.nav-links.no-top.no-bottom .fade-left= icon('angle-left')
.fade-right= icon('angle-right')
%ul.merge-request-tabs.nav-links.scrolling-tabs
%li.notes-tab %li.notes-tab
= link_to namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: { target: 'div#notes', action: 'notes', toggle: 'tab' } do = link_to namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: { target: 'div#notes', action: 'notes', toggle: 'tab' } do
Discussion Discussion
......
%ul.nav-links.search-filter .scrolling-tabs-container.inner-page-scroll-tabs
- if @project .fade-left= icon('angle-left')
%li{ class: active_when(@scope == 'blobs') } .fade-right= icon('angle-right')
= link_to search_filter_path(scope: 'blobs') do %ul.nav-links.search-filter.scrolling-tabs
Code - if @project
%span.badge %li{ class: active_when(@scope == 'blobs') }
= @search_results.blobs_count = link_to search_filter_path(scope: 'blobs') do
%li{ class: active_when(@scope == 'issues') } Code
= link_to search_filter_path(scope: 'issues') do %span.badge
Issues = @search_results.blobs_count
%span.badge %li{ class: active_when(@scope == 'issues') }
= @search_results.issues_count = link_to search_filter_path(scope: 'issues') do
%li{ class: active_when(@scope == 'merge_requests') } Issues
= link_to search_filter_path(scope: 'merge_requests') do %span.badge
Merge requests = @search_results.issues_count
%span.badge %li{ class: active_when(@scope == 'merge_requests') }
= @search_results.merge_requests_count = link_to search_filter_path(scope: 'merge_requests') do
%li{ class: active_when(@scope == 'milestones') } Merge requests
= link_to search_filter_path(scope: 'milestones') do %span.badge
Milestones = @search_results.merge_requests_count
%span.badge %li{ class: active_when(@scope == 'milestones') }
= @search_results.milestones_count = link_to search_filter_path(scope: 'milestones') do
%li{ class: active_when(@scope == 'notes') } Milestones
= link_to search_filter_path(scope: 'notes') do %span.badge
Comments = @search_results.milestones_count
%span.badge %li{ class: active_when(@scope == 'notes') }
= @search_results.notes_count = link_to search_filter_path(scope: 'notes') do
%li{ class: active_when(@scope == 'wiki_blobs') } Comments
= link_to search_filter_path(scope: 'wiki_blobs') do %span.badge
Wiki = @search_results.notes_count
%span.badge %li{ class: active_when(@scope == 'wiki_blobs') }
= @search_results.wiki_blobs_count = link_to search_filter_path(scope: 'wiki_blobs') do
%li{ class: active_when(@scope == 'commits') } Wiki
= link_to search_filter_path(scope: 'commits') do %span.badge
Commits = @search_results.wiki_blobs_count
%span.badge %li{ class: active_when(@scope == 'commits') }
= @search_results.commits_count = link_to search_filter_path(scope: 'commits') do
Commits
%span.badge
= @search_results.commits_count
- elsif @show_snippets - elsif @show_snippets
%li{ class: active_when(@scope == 'snippet_blobs') } %li{ class: active_when(@scope == 'snippet_blobs') }
= link_to search_filter_path(scope: 'snippet_blobs', snippets: true, group_id: nil, project_id: nil) do = link_to search_filter_path(scope: 'snippet_blobs', snippets: true, group_id: nil, project_id: nil) do
Snippet Contents Snippet Contents
%span.badge %span.badge
= @search_results.snippet_blobs_count = @search_results.snippet_blobs_count
%li{ class: active_when(@scope == 'snippet_titles') } %li{ class: active_when(@scope == 'snippet_titles') }
= link_to search_filter_path(scope: 'snippet_titles', snippets: true, group_id: nil, project_id: nil) do = link_to search_filter_path(scope: 'snippet_titles', snippets: true, group_id: nil, project_id: nil) do
Titles and Filenames Titles and Filenames
%span.badge %span.badge
= @search_results.snippet_titles_count = @search_results.snippet_titles_count
- else - else
%li{ class: active_when(@scope == 'projects') } %li{ class: active_when(@scope == 'projects') }
= link_to search_filter_path(scope: 'projects') do = link_to search_filter_path(scope: 'projects') do
Projects Projects
%span.badge %span.badge
= @search_results.projects_count = @search_results.projects_count
%li{ class: active_when(@scope == 'issues') } %li{ class: active_when(@scope == 'issues') }
= link_to search_filter_path(scope: 'issues') do = link_to search_filter_path(scope: 'issues') do
Issues Issues
%span.badge %span.badge
= @search_results.issues_count = @search_results.issues_count
%li{ class: active_when(@scope == 'merge_requests') } %li{ class: active_when(@scope == 'merge_requests') }
= link_to search_filter_path(scope: 'merge_requests') do = link_to search_filter_path(scope: 'merge_requests') do
Merge requests Merge requests
%span.badge %span.badge
= @search_results.merge_requests_count = @search_results.merge_requests_count
%li{ class: active_when(@scope == 'milestones') } %li{ class: active_when(@scope == 'milestones') }
= link_to search_filter_path(scope: 'milestones') do = link_to search_filter_path(scope: 'milestones') do
Milestones Milestones
%span.badge %span.badge
= @search_results.milestones_count = @search_results.milestones_count
%ul.nav-links.no-top.no-bottom .scrolling-tabs-container.inner-page-scroll-tabs
- if milestone.is_a?(GlobalMilestone) || can?(current_user, :read_issue, @project) .fade-left= icon('angle-left')
%li.active .fade-right= icon('angle-right')
= link_to '#tab-issues', 'data-toggle' => 'tab', 'data-show' => '.tab-issues-buttons' do %ul.nav-links.scrolling-tabs
Issues - if milestone.is_a?(GlobalMilestone) || can?(current_user, :read_issue, @project)
%span.badge= milestone.issues_visible_to_user(current_user).size %li.active
= link_to '#tab-issues', 'data-toggle' => 'tab', 'data-show' => '.tab-issues-buttons' do
Issues
%span.badge= milestone.issues_visible_to_user(current_user).size
%li
= link_to '#tab-merge-requests', 'data-toggle' => 'tab', 'data-show' => '.tab-merge-requests-buttons' do
Merge Requests
%span.badge= milestone.merge_requests.size
- else
%li.active
= link_to '#tab-merge-requests', 'data-toggle' => 'tab', 'data-show' => '.tab-merge-requests-buttons' do
Merge Requests
%span.badge= milestone.merge_requests.size
%li %li
= link_to '#tab-merge-requests', 'data-toggle' => 'tab', 'data-show' => '.tab-merge-requests-buttons' do = link_to '#tab-participants', 'data-toggle' => 'tab' do
Merge Requests Participants
%span.badge= milestone.merge_requests.size %span.badge= milestone.participants.count
- else %li
%li.active = link_to '#tab-labels', 'data-toggle' => 'tab' do
= link_to '#tab-merge-requests', 'data-toggle' => 'tab', 'data-show' => '.tab-merge-requests-buttons' do Labels
Merge Requests %span.badge= milestone.labels.count
%span.badge= milestone.merge_requests.size
%li
= link_to '#tab-participants', 'data-toggle' => 'tab' do
Participants
%span.badge= milestone.participants.count
%li
= link_to '#tab-labels', 'data-toggle' => 'tab' do
Labels
%span.badge= milestone.labels.count
- show_project_name = local_assigns.fetch(:show_project_name, false) - show_project_name = local_assigns.fetch(:show_project_name, false)
- show_full_project_name = local_assigns.fetch(:show_full_project_name, false) - show_full_project_name = local_assigns.fetch(:show_full_project_name, false)
......
---
title: Fixed tabs not scrolling on mobile
merge_request:
author:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment