Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4e03f4c4
Commit
4e03f4c4
authored
Oct 19, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issues with sticky mr tabs & sidebar
Closes #23504
parent
672ab77b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
46 deletions
+54
-46
app/assets/javascripts/merge_request_tabs.js
app/assets/javascripts/merge_request_tabs.js
+1
-10
app/assets/stylesheets/framework/sidebar.scss
app/assets/stylesheets/framework/sidebar.scss
+8
-0
app/assets/stylesheets/pages/merge_requests.scss
app/assets/stylesheets/pages/merge_requests.scss
+10
-3
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+35
-33
No files found.
app/assets/javascripts/merge_request_tabs.js
View file @
4e03f4c4
...
@@ -388,8 +388,7 @@
...
@@ -388,8 +388,7 @@
// So we dont affix the tabs on these
// So we dont affix the tabs on these
if
(
Breakpoints
.
get
().
getBreakpointSize
()
===
'
xs
'
||
!
$tabs
.
length
)
return
;
if
(
Breakpoints
.
get
().
getBreakpointSize
()
===
'
xs
'
||
!
$tabs
.
length
)
return
;
var
tabsWidth
=
$tabs
.
outerWidth
(),
var
$diffTabs
=
$
(
'
#diff-notes-app
'
),
$diffTabs
=
$
(
'
#diff-notes-app
'
),
offsetTop
=
$tabs
.
offset
().
top
-
(
$
(
'
.navbar-fixed-top
'
).
height
()
+
$
(
'
.layout-nav
'
).
height
());
offsetTop
=
$tabs
.
offset
().
top
-
(
$
(
'
.navbar-fixed-top
'
).
height
()
+
$
(
'
.layout-nav
'
).
height
());
$tabs
.
off
(
'
affix.bs.affix affix-top.bs.affix
'
)
$tabs
.
off
(
'
affix.bs.affix affix-top.bs.affix
'
)
...
@@ -398,18 +397,10 @@
...
@@ -398,18 +397,10 @@
top
:
offsetTop
top
:
offsetTop
}
}
}).
on
(
'
affix.bs.affix
'
,
function
()
{
}).
on
(
'
affix.bs.affix
'
,
function
()
{
$tabs
.
css
({
left
:
$tabs
.
offset
().
left
,
width
:
tabsWidth
});
$diffTabs
.
css
({
$diffTabs
.
css
({
marginTop
:
$tabs
.
height
()
marginTop
:
$tabs
.
height
()
});
});
}).
on
(
'
affix-top.bs.affix
'
,
function
()
{
}).
on
(
'
affix-top.bs.affix
'
,
function
()
{
$tabs
.
css
({
left
:
''
,
width
:
''
});
$diffTabs
.
css
({
$diffTabs
.
css
({
marginTop
:
''
marginTop
:
''
});
});
...
...
app/assets/stylesheets/framework/sidebar.scss
View file @
4e03f4c4
...
@@ -185,6 +185,10 @@ header.header-sidebar-pinned {
...
@@ -185,6 +185,10 @@ header.header-sidebar-pinned {
@media
(
min-width
:
$screen-sm-min
)
{
@media
(
min-width
:
$screen-sm-min
)
{
padding-right
:
$sidebar_collapsed_width
;
padding-right
:
$sidebar_collapsed_width
;
.merge-request-tabs-holder.affix
{
right
:
$sidebar_collapsed_width
;
}
}
}
.sidebar-collapsed-icon
{
.sidebar-collapsed-icon
{
...
@@ -207,6 +211,10 @@ header.header-sidebar-pinned {
...
@@ -207,6 +211,10 @@ header.header-sidebar-pinned {
@media
(
min-width
:
$screen-md-min
)
{
@media
(
min-width
:
$screen-md-min
)
{
padding-right
:
$gutter_width
;
padding-right
:
$gutter_width
;
.merge-request-tabs-holder.affix
{
right
:
$gutter_width
;
}
}
}
&
.with-overlay
{
&
.with-overlay
{
...
...
app/assets/stylesheets/pages/merge_requests.scss
View file @
4e03f4c4
...
@@ -183,11 +183,11 @@
...
@@ -183,11 +183,11 @@
.ci-coverage
{
.ci-coverage
{
float
:
right
;
float
:
right
;
}
}
.stop-env-container
{
.stop-env-container
{
color
:
$gl-text-color
;
color
:
$gl-text-color
;
float
:
right
;
float
:
right
;
a
{
a
{
color
:
$gl-text-color
;
color
:
$gl-text-color
;
}
}
...
@@ -438,11 +438,18 @@
...
@@ -438,11 +438,18 @@
}
}
}
}
.merge-request-tabs
{
.merge-request-tabs
-holder
{
background-color
:
#fff
;
background-color
:
#fff
;
&
.affix
{
&
.affix
{
top
:
100px
;
top
:
100px
;
left
:
0
;
z-index
:
9
;
z-index
:
9
;
transition
:
right
.15s
;
}
&
:not
(
.affix
)
.container-fluid
{
padding-left
:
0
;
padding-right
:
0
;
}
}
}
}
app/views/projects/merge_requests/_show.html.haml
View file @
4e03f4c4
...
@@ -47,39 +47,41 @@
...
@@ -47,39 +47,41 @@
=
link_to
"command line"
,
"#modal_merge_info"
,
class:
"how_to_merge_link vlink"
,
title:
"How To Merge"
,
"data-toggle"
=>
"modal"
=
link_to
"command line"
,
"#modal_merge_info"
,
class:
"how_to_merge_link vlink"
,
title:
"How To Merge"
,
"data-toggle"
=>
"modal"
-
if
@commits_count
.
nonzero?
-
if
@commits_count
.
nonzero?
%ul
.merge-request-tabs.nav-links.no-top.no-bottom
{
class:
(
"js-tabs-affix"
unless
ENV
[
'RAILS_ENV'
]
==
'test'
)
}
.merge-request-tabs-holder
{
class:
(
"js-tabs-affix"
unless
ENV
[
'RAILS_ENV'
]
==
'test'
)
}
%li
.notes-tab
%div
{
class:
container_class
}
=
link_to
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#notes'
,
action:
'notes'
,
toggle:
'tab'
}
do
%ul
.merge-request-tabs.nav-links.no-top.no-bottom
Discussion
%li
.notes-tab
%span
.badge
=
@merge_request
.
mr_and_commit_notes
.
user
.
count
=
link_to
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#notes'
,
action:
'notes'
,
toggle:
'tab'
}
do
-
if
@merge_request
.
source_project
Discussion
%li
.commits-tab
%span
.badge
=
@merge_request
.
mr_and_commit_notes
.
user
.
count
=
link_to
commits_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#commits'
,
action:
'commits'
,
toggle:
'tab'
}
do
-
if
@merge_request
.
source_project
Commits
%li
.commits-tab
%span
.badge
=
@commits_count
=
link_to
commits_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#commits'
,
action:
'commits'
,
toggle:
'tab'
}
do
-
if
@pipeline
Commits
%li
.pipelines-tab
%span
.badge
=
@commits_count
=
link_to
pipelines_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#pipelines'
,
action:
'pipelines'
,
toggle:
'tab'
}
do
-
if
@pipeline
Pipelines
%li
.pipelines-tab
%span
.badge
=
@pipelines
.
size
=
link_to
pipelines_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#pipelines'
,
action:
'pipelines'
,
toggle:
'tab'
}
do
%li
.builds-tab
Pipelines
=
link_to
builds_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#builds'
,
action:
'builds'
,
toggle:
'tab'
}
do
%span
.badge
=
@pipelines
.
size
Builds
%li
.builds-tab
%span
.badge
=
@statuses
.
size
=
link_to
builds_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#builds'
,
action:
'builds'
,
toggle:
'tab'
}
do
%li
.diffs-tab
Builds
=
link_to
diffs_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#diffs'
,
action:
'diffs'
,
toggle:
'tab'
}
do
%span
.badge
=
@statuses
.
size
Changes
%li
.diffs-tab
%span
.badge
=
@merge_request
.
diff_size
=
link_to
diffs_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#diffs'
,
action:
'diffs'
,
toggle:
'tab'
}
do
%li
#resolve-count-app
.line-resolve-all-container.pull-right.prepend-top-10.hidden-xs
{
"v-cloak"
=>
true
}
Changes
%resolve-count
{
"inline-template"
=>
true
,
":logged-out"
=>
"#{current_user.nil?}"
}
%span
.badge
=
@merge_request
.
diff_size
.line-resolve-all
{
"v-show"
=>
"discussionCount > 0"
,
%li
#resolve-count-app
.line-resolve-all-container.pull-right.prepend-top-10.hidden-xs
{
"v-cloak"
=>
true
}
":class"
=>
"{ 'has-next-btn': !loggedOut && resolvedDiscussionCount !== discussionCount }"
}
%resolve-count
{
"inline-template"
=>
true
,
":logged-out"
=>
"#{current_user.nil?}"
}
%span
.line-resolve-btn.is-disabled
{
type:
"button"
,
.line-resolve-all
{
"v-show"
=>
"discussionCount > 0"
,
":class"
=>
"{ 'is-active': resolvedDiscussionCount === discussionCount }"
}
":class"
=>
"{ 'has-next-btn': !loggedOut && resolvedDiscussionCount !== discussionCount }"
}
=
render
"shared/icons/icon_status_success.svg"
%span
.line-resolve-btn.is-disabled
{
type:
"button"
,
%span
.line-resolve-text
":class"
=>
"{ 'is-active': resolvedDiscussionCount === discussionCount }"
}
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ discussionCount | pluralize 'discussion' }} resolved
=
render
"shared/icons/icon_status_success.svg"
=
render
"discussions/jump_to_next"
%span
.line-resolve-text
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ discussionCount | pluralize 'discussion' }} resolved
=
render
"discussions/jump_to_next"
.tab-content
#diff-notes-app
.tab-content
#diff-notes-app
#notes
.notes.tab-pane.voting_notes
#notes
.notes.tab-pane.voting_notes
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment