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
27bce7ad
Commit
27bce7ad
authored
Aug 28, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed IDE file row jumping into view on hover
Closes #50751
parent
9248240c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
5 deletions
+33
-5
app/assets/javascripts/ide/components/repo_file.vue
app/assets/javascripts/ide/components/repo_file.vue
+7
-5
changelogs/unreleased/ide-row-hover-scroll.yml
changelogs/unreleased/ide-row-hover-scroll.yml
+5
-0
spec/javascripts/ide/components/repo_file_spec.js
spec/javascripts/ide/components/repo_file_spec.js
+21
-0
No files found.
app/assets/javascripts/ide/components/repo_file.vue
View file @
27bce7ad
...
...
@@ -95,16 +95,18 @@ export default {
return
this
.
file
.
changed
||
this
.
file
.
tempFile
||
this
.
file
.
staged
;
},
},
watch
:
{
'
file.active
'
:
function
fileActiveWatch
(
active
)
{
if
(
this
.
file
.
type
===
'
blob
'
&&
active
)
{
this
.
scrollIntoView
();
}
},
},
mounted
()
{
if
(
this
.
hasPathAtCurrentRoute
())
{
this
.
scrollIntoView
(
true
);
}
},
updated
()
{
if
(
this
.
file
.
type
===
'
blob
'
&&
this
.
file
.
active
)
{
this
.
scrollIntoView
();
}
},
methods
:
{
...
mapActions
([
'
toggleTreeOpen
'
]),
clickFile
()
{
...
...
changelogs/unreleased/ide-row-hover-scroll.yml
0 → 100644
View file @
27bce7ad
---
title
:
Fixed IDE file row scrolling into view when hovering
merge_request
:
author
:
type
:
fixed
spec/javascripts/ide/components/repo_file_spec.js
View file @
27bce7ad
...
...
@@ -121,4 +121,25 @@ describe('RepoFile', () => {
).
toContain
(
'
Locked by testuser
'
);
});
});
it
(
'
calls scrollIntoView if made active
'
,
done
=>
{
createComponent
({
file
:
{
...
file
(),
type
:
'
blob
'
,
active
:
false
,
},
level
:
0
,
});
spyOn
(
vm
,
'
scrollIntoView
'
);
vm
.
file
.
active
=
true
;
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
scrollIntoView
).
toHaveBeenCalled
();
done
();
});
});
});
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