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
c7609180
Commit
c7609180
authored
Aug 07, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the sticky changes bar on commits page
parent
8fbbd3f2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
14 deletions
+23
-14
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+3
-0
app/assets/javascripts/init_changes_dropdown.js
app/assets/javascripts/init_changes_dropdown.js
+10
-0
app/assets/javascripts/merge_request_tabs.js
app/assets/javascripts/merge_request_tabs.js
+2
-11
app/assets/stylesheets/pages/diff.scss
app/assets/stylesheets/pages/diff.scss
+5
-1
app/views/projects/diffs/_diffs.html.haml
app/views/projects/diffs/_diffs.html.haml
+2
-1
app/views/projects/merge_requests/diffs/_diffs.html.haml
app/views/projects/merge_requests/diffs/_diffs.html.haml
+1
-1
No files found.
app/assets/javascripts/dispatcher.js
View file @
c7609180
...
@@ -76,6 +76,7 @@ import initLegacyFilters from './init_legacy_filters';
...
@@ -76,6 +76,7 @@ import initLegacyFilters from './init_legacy_filters';
import
initIssuableSidebar
from
'
./init_issuable_sidebar
'
;
import
initIssuableSidebar
from
'
./init_issuable_sidebar
'
;
import
GpgBadges
from
'
./gpg_badges
'
;
import
GpgBadges
from
'
./gpg_badges
'
;
import
UserFeatureHelper
from
'
./helpers/user_feature_helper
'
;
import
UserFeatureHelper
from
'
./helpers/user_feature_helper
'
;
import
initChangesDropdown
from
'
./init_changes_dropdown
'
;
(
function
()
{
(
function
()
{
var
Dispatcher
;
var
Dispatcher
;
...
@@ -228,6 +229,7 @@ import UserFeatureHelper from './helpers/user_feature_helper';
...
@@ -228,6 +229,7 @@ import UserFeatureHelper from './helpers/user_feature_helper';
break
;
break
;
case
'
projects:compare:show
'
:
case
'
projects:compare:show
'
:
new
gl
.
Diff
();
new
gl
.
Diff
();
initChangesDropdown
();
break
;
break
;
case
'
projects:branches:new
'
:
case
'
projects:branches:new
'
:
case
'
projects:branches:create
'
:
case
'
projects:branches:create
'
:
...
@@ -320,6 +322,7 @@ import UserFeatureHelper from './helpers/user_feature_helper';
...
@@ -320,6 +322,7 @@ import UserFeatureHelper from './helpers/user_feature_helper';
container
:
'
.js-commit-pipeline-graph
'
,
container
:
'
.js-commit-pipeline-graph
'
,
}).
bindEvents
();
}).
bindEvents
();
initNotes
();
initNotes
();
initChangesDropdown
();
$
(
'
.commit-info.branches
'
).
load
(
document
.
querySelector
(
'
.js-commit-box
'
).
dataset
.
commitPath
);
$
(
'
.commit-info.branches
'
).
load
(
document
.
querySelector
(
'
.js-commit-box
'
).
dataset
.
commitPath
);
break
;
break
;
case
'
projects:commit:pipelines
'
:
case
'
projects:commit:pipelines
'
:
...
...
app/assets/javascripts/init_changes_dropdown.js
0 → 100644
View file @
c7609180
import
stickyMonitor
from
'
./lib/utils/sticky
'
;
export
default
()
=>
{
stickyMonitor
(
document
.
querySelector
(
'
.js-diff-files-changed
'
));
$
(
'
.js-diff-stats-dropdown
'
).
glDropdown
({
filterable
:
true
,
remoteFilter
:
false
,
});
};
app/assets/javascripts/merge_request_tabs.js
View file @
c7609180
...
@@ -7,7 +7,7 @@ import Cookies from 'js-cookie';
...
@@ -7,7 +7,7 @@ import Cookies from 'js-cookie';
import
'
./breakpoints
'
;
import
'
./breakpoints
'
;
import
'
./flash
'
;
import
'
./flash
'
;
import
BlobForkSuggestion
from
'
./blob/blob_fork_suggestion
'
;
import
BlobForkSuggestion
from
'
./blob/blob_fork_suggestion
'
;
import
stickyMonitor
from
'
./lib/utils/sticky
'
;
import
initChangesDropdown
from
'
./init_changes_dropdown
'
;
/* eslint-disable max-len */
/* eslint-disable max-len */
// MergeRequestTabs
// MergeRequestTabs
...
@@ -267,9 +267,7 @@ import stickyMonitor from './lib/utils/sticky';
...
@@ -267,9 +267,7 @@ import stickyMonitor from './lib/utils/sticky';
const
$container
=
$
(
'
#diffs
'
);
const
$container
=
$
(
'
#diffs
'
);
$container
.
html
(
data
.
html
);
$container
.
html
(
data
.
html
);
this
.
initChangesDropdown
();
initChangesDropdown
();
stickyMonitor
(
document
.
querySelector
(
'
.js-diff-files-changed
'
));
if
(
typeof
gl
.
diffNotesCompileComponents
!==
'
undefined
'
)
{
if
(
typeof
gl
.
diffNotesCompileComponents
!==
'
undefined
'
)
{
gl
.
diffNotesCompileComponents
();
gl
.
diffNotesCompileComponents
();
...
@@ -319,13 +317,6 @@ import stickyMonitor from './lib/utils/sticky';
...
@@ -319,13 +317,6 @@ import stickyMonitor from './lib/utils/sticky';
});
});
}
}
initChangesDropdown
()
{
$
(
'
.js-diff-stats-dropdown
'
).
glDropdown
({
filterable
:
true
,
remoteFilter
:
false
,
});
}
// Show or hide the loading spinner
// Show or hide the loading spinner
//
//
// status - Boolean, true to show, false to hide
// status - Boolean, true to show, false to hide
...
...
app/assets/stylesheets/pages/diff.scss
View file @
c7609180
...
@@ -574,10 +574,14 @@
...
@@ -574,10 +574,14 @@
@media
(
min-width
:
$screen-sm-min
)
{
@media
(
min-width
:
$screen-sm-min
)
{
position
:
-
webkit-sticky
;
position
:
-
webkit-sticky
;
position
:
sticky
;
position
:
sticky
;
top
:
8
4px
;
top
:
3
4px
;
background-color
:
$white-light
;
background-color
:
$white-light
;
z-index
:
190
;
z-index
:
190
;
&
.diff-files-changed-merge-request
{
top
:
84px
;
}
+
.files
,
+
.files
,
+
.alert
{
+
.alert
{
margin-top
:
1px
;
margin-top
:
1px
;
...
...
app/views/projects/diffs/_diffs.html.haml
View file @
c7609180
...
@@ -2,8 +2,9 @@
...
@@ -2,8 +2,9 @@
-
show_whitespace_toggle
=
local_assigns
.
fetch
(
:show_whitespace_toggle
,
true
)
-
show_whitespace_toggle
=
local_assigns
.
fetch
(
:show_whitespace_toggle
,
true
)
-
can_create_note
=
!
@diff_notes_disabled
&&
can?
(
current_user
,
:create_note
,
diffs
.
project
)
-
can_create_note
=
!
@diff_notes_disabled
&&
can?
(
current_user
,
:create_note
,
diffs
.
project
)
-
diff_files
=
diffs
.
diff_files
-
diff_files
=
diffs
.
diff_files
-
merge_request
=
local_assigns
.
fetch
(
:merge_request
,
false
)
.content-block.oneline-block.files-changed.diff-files-changed.js-diff-files-changed
.content-block.oneline-block.files-changed.diff-files-changed.js-diff-files-changed
{
class:
(
"diff-files-changed-merge-request"
if
merge_request
)
}
.files-changed-inner
.files-changed-inner
.inline-parallel-buttons
.inline-parallel-buttons
-
if
!
diffs_expanded?
&&
diff_files
.
any?
{
|
diff_file
|
diff_file
.
collapsed?
}
-
if
!
diffs_expanded?
&&
diff_files
.
any?
{
|
diff_file
|
diff_file
.
collapsed?
}
...
...
app/views/projects/merge_requests/diffs/_diffs.html.haml
View file @
c7609180
-
if
@merge_request_diff
.
collected?
||
@merge_request_diff
.
overflow?
-
if
@merge_request_diff
.
collected?
||
@merge_request_diff
.
overflow?
=
render
'projects/merge_requests/diffs/versions'
=
render
'projects/merge_requests/diffs/versions'
=
render
"projects/diffs/diffs"
,
diffs:
@diffs
,
environment:
@environment
=
render
"projects/diffs/diffs"
,
diffs:
@diffs
,
environment:
@environment
,
merge_request:
true
-
elsif
@merge_request_diff
.
empty?
-
elsif
@merge_request_diff
.
empty?
.nothing-here-block
Nothing to merge from
#{
@merge_request
.
source_branch
}
into
#{
@merge_request
.
target_branch
}
.nothing-here-block
Nothing to merge from
#{
@merge_request
.
source_branch
}
into
#{
@merge_request
.
target_branch
}
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