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
48fb30f7
Commit
48fb30f7
authored
Apr 18, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed up scrolling to items in finder dropdown
parent
27be9666
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
app/assets/javascripts/ide/components/file_finder/index.vue
app/assets/javascripts/ide/components/file_finder/index.vue
+18
-3
app/assets/javascripts/ide/components/file_finder/item.vue
app/assets/javascripts/ide/components/file_finder/item.vue
+4
-0
No files found.
app/assets/javascripts/ide/components/file_finder/index.vue
View file @
48fb30f7
...
...
@@ -78,8 +78,22 @@ export default {
if
(
!
this
.
mouseOver
)
{
this
.
$nextTick
(()
=>
{
const
el
=
this
.
$refs
.
virtualScrollList
.
$el
;
const
scrollTop
=
this
.
focusedIndex
*
FILE_FINDER_ROW_HEIGHT
;
const
bottom
=
this
.
listShowCount
*
FILE_FINDER_ROW_HEIGHT
;
el
.
scrollTop
=
this
.
focusedIndex
*
55
;
if
(
this
.
focusedIndex
===
0
)
{
// if index is the first index, scroll straight to start
el
.
scrollTop
=
0
;
}
else
if
(
this
.
focusedIndex
===
this
.
filteredBlobsLength
-
1
)
{
// if index is the last index, scroll to the end
el
.
scrollTop
=
this
.
filteredBlobsLength
*
FILE_FINDER_ROW_HEIGHT
;
}
else
if
(
scrollTop
>=
bottom
+
el
.
scrollTop
)
{
// if element is off the bottom of the scroll list, scroll down one item
el
.
scrollTop
=
scrollTop
-
bottom
+
FILE_FINDER_ROW_HEIGHT
;
}
else
if
(
scrollTop
<
el
.
scrollTop
)
{
// if element is off the top of the scroll list, scroll up one item
el
.
scrollTop
=
scrollTop
;
}
});
}
},
...
...
@@ -141,8 +155,9 @@ export default {
this
.
focusedIndex
=
index
;
}
},
onMouseMove
()
{
onMouseMove
(
index
)
{
this
.
cancelMouseOver
=
false
;
this
.
onMouseOver
(
index
);
},
},
};
...
...
@@ -152,7 +167,6 @@ export default {
<div
class=
"ide-file-finder-overlay"
@
mousedown.self=
"toggleFileFinder(false)"
@
mousemove=
"onMouseMove"
>
<div
class=
"dropdown-menu diff-file-changes ide-file-finder show"
...
...
@@ -205,6 +219,7 @@ export default {
:index=
"index"
@
click=
"openFile"
@
mouseover=
"onMouseOver"
@
mousemove=
"onMouseMove"
/>
</li>
</
template
>
...
...
app/assets/javascripts/ide/components/file_finder/item.vue
View file @
48fb30f7
...
...
@@ -50,6 +50,9 @@ export default {
mouseOverRow
()
{
this
.
$emit
(
'
mouseover
'
,
this
.
index
);
},
mouseMove
()
{
this
.
$emit
(
'
mousemove
'
,
this
.
index
);
},
},
};
</
script
>
...
...
@@ -63,6 +66,7 @@ export default {
}"
@click.prevent="clickRow"
@mouseover="mouseOverRow"
@mousemove="mouseMove"
>
<file-icon
:file-name=
"file.name"
...
...
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