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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
35daaa36
Commit
35daaa36
authored
Oct 23, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
calculate the stickyTop instead of hard coding a variable
parent
016e7503
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+2
-1
app/assets/javascripts/init_changes_dropdown.js
app/assets/javascripts/init_changes_dropdown.js
+2
-2
app/assets/javascripts/merge_request_tabs.js
app/assets/javascripts/merge_request_tabs.js
+9
-1
No files found.
app/assets/javascripts/dispatcher.js
View file @
35daaa36
...
@@ -239,7 +239,8 @@ import Diff from './diff';
...
@@ -239,7 +239,8 @@ import Diff from './diff';
break
;
break
;
case
'
projects:compare:show
'
:
case
'
projects:compare:show
'
:
new
Diff
();
new
Diff
();
initChangesDropdown
();
const
paddingTop
=
16
;
initChangesDropdown
(
document
.
querySelector
(
'
.navbar-gitlab
'
).
offsetHeight
-
paddingTop
);
break
;
break
;
case
'
projects:branches:new
'
:
case
'
projects:branches:new
'
:
case
'
projects:branches:create
'
:
case
'
projects:branches:create
'
:
...
...
app/assets/javascripts/init_changes_dropdown.js
View file @
35daaa36
import
stickyMonitor
from
'
./lib/utils/sticky
'
;
import
stickyMonitor
from
'
./lib/utils/sticky
'
;
export
default
()
=>
{
export
default
(
stickyTop
)
=>
{
stickyMonitor
(
document
.
querySelector
(
'
.js-diff-files-changed
'
),
76
);
stickyMonitor
(
document
.
querySelector
(
'
.js-diff-files-changed
'
),
stickyTop
);
$
(
'
.js-diff-stats-dropdown
'
).
glDropdown
({
$
(
'
.js-diff-stats-dropdown
'
).
glDropdown
({
filterable
:
true
,
filterable
:
true
,
...
...
app/assets/javascripts/merge_request_tabs.js
View file @
35daaa36
...
@@ -67,6 +67,9 @@ import Diff from './diff';
...
@@ -67,6 +67,9 @@ import Diff from './diff';
class
MergeRequestTabs
{
class
MergeRequestTabs
{
constructor
({
action
,
setUrl
,
stubLocation
}
=
{})
{
constructor
({
action
,
setUrl
,
stubLocation
}
=
{})
{
const
mergeRequestTabs
=
document
.
querySelector
(
'
.js-tabs-affix
'
);
const
paddingTop
=
16
;
this
.
diffsLoaded
=
false
;
this
.
diffsLoaded
=
false
;
this
.
pipelinesLoaded
=
false
;
this
.
pipelinesLoaded
=
false
;
this
.
commitsLoaded
=
false
;
this
.
commitsLoaded
=
false
;
...
@@ -76,6 +79,11 @@ import Diff from './diff';
...
@@ -76,6 +79,11 @@ import Diff from './diff';
this
.
setCurrentAction
=
this
.
setCurrentAction
.
bind
(
this
);
this
.
setCurrentAction
=
this
.
setCurrentAction
.
bind
(
this
);
this
.
tabShown
=
this
.
tabShown
.
bind
(
this
);
this
.
tabShown
=
this
.
tabShown
.
bind
(
this
);
this
.
showTab
=
this
.
showTab
.
bind
(
this
);
this
.
showTab
=
this
.
showTab
.
bind
(
this
);
this
.
stickyTop
=
document
.
querySelector
(
'
.navbar-gitlab
'
).
offsetHeight
-
paddingTop
;
if
(
mergeRequestTabs
)
{
this
.
stickyTop
+=
mergeRequestTabs
.
offsetHeight
;
}
if
(
stubLocation
)
{
if
(
stubLocation
)
{
location
=
stubLocation
;
location
=
stubLocation
;
...
@@ -278,7 +286,7 @@ import Diff from './diff';
...
@@ -278,7 +286,7 @@ import Diff from './diff';
const
$container
=
$
(
'
#diffs
'
);
const
$container
=
$
(
'
#diffs
'
);
$container
.
html
(
data
.
html
);
$container
.
html
(
data
.
html
);
initChangesDropdown
();
initChangesDropdown
(
this
.
stickyTop
);
if
(
typeof
gl
.
diffNotesCompileComponents
!==
'
undefined
'
)
{
if
(
typeof
gl
.
diffNotesCompileComponents
!==
'
undefined
'
)
{
gl
.
diffNotesCompileComponents
();
gl
.
diffNotesCompileComponents
();
...
...
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