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
02a5462b
Commit
02a5462b
authored
Jul 08, 2021
by
Lukas 'Eipi' Eipert
Committed by
Phil Hughes
Jul 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only render FileFinderOverlay when needed
parent
5226c013
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
6 deletions
+15
-6
app/assets/javascripts/diffs/index.js
app/assets/javascripts/diffs/index.js
+0
-3
app/assets/javascripts/ide/components/ide.vue
app/assets/javascripts/ide/components/ide.vue
+0
-1
app/assets/javascripts/vue_shared/components/file_finder/index.vue
...s/javascripts/vue_shared/components/file_finder/index.vue
+4
-1
spec/frontend/vue_shared/components/file_finder/index_spec.js
.../frontend/vue_shared/components/file_finder/index_spec.js
+11
-1
No files found.
app/assets/javascripts/diffs/index.js
View file @
02a5462b
...
@@ -50,9 +50,6 @@ export default function initDiffsApp(store) {
...
@@ -50,9 +50,6 @@ export default function initDiffsApp(store) {
click
:
this
.
openFile
,
click
:
this
.
openFile
,
},
},
class
:
[
'
diff-file-finder
'
],
class
:
[
'
diff-file-finder
'
],
style
:
{
display
:
this
.
fileFinderVisible
?
''
:
'
none
'
,
},
});
});
},
},
});
});
...
...
app/assets/javascripts/ide/components/ide.vue
View file @
02a5462b
...
@@ -130,7 +130,6 @@ export default {
...
@@ -130,7 +130,6 @@ export default {
<div
class=
"ide-view flex-grow d-flex"
>
<div
class=
"ide-view flex-grow d-flex"
>
<template
v-if=
"loadDeferred"
>
<template
v-if=
"loadDeferred"
>
<find-file
<find-file
v-show=
"fileFindVisible"
:files=
"allBlobs"
:files=
"allBlobs"
:visible=
"fileFindVisible"
:visible=
"fileFindVisible"
:loading=
"loading"
:loading=
"loading"
...
...
app/assets/javascripts/vue_shared/components/file_finder/index.vue
View file @
02a5462b
...
@@ -103,6 +103,9 @@ export default {
...
@@ -103,6 +103,9 @@ export default {
focusedIndex
()
{
focusedIndex
()
{
if
(
!
this
.
mouseOver
)
{
if
(
!
this
.
mouseOver
)
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
if
(
!
this
.
$refs
.
virtualScrollList
?.
$el
)
{
return
;
}
const
el
=
this
.
$refs
.
virtualScrollList
.
$el
;
const
el
=
this
.
$refs
.
virtualScrollList
.
$el
;
const
scrollTop
=
this
.
focusedIndex
*
FILE_FINDER_ROW_HEIGHT
;
const
scrollTop
=
this
.
focusedIndex
*
FILE_FINDER_ROW_HEIGHT
;
const
bottom
=
this
.
listShowCount
*
FILE_FINDER_ROW_HEIGHT
;
const
bottom
=
this
.
listShowCount
*
FILE_FINDER_ROW_HEIGHT
;
...
@@ -218,7 +221,7 @@ export default {
...
@@ -218,7 +221,7 @@ export default {
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"file-finder-overlay"
@
mousedown.self=
"toggle(false)"
>
<div
v-if=
"visible"
class=
"file-finder-overlay"
@
mousedown.self=
"toggle(false)"
>
<div
class=
"dropdown-menu diff-file-changes file-finder show"
>
<div
class=
"dropdown-menu diff-file-changes file-finder show"
>
<div
:class=
"
{ 'has-value': showClearInputButton }" class="dropdown-input">
<div
:class=
"
{ 'has-value': showClearInputButton }" class="dropdown-input">
<input
<input
...
...
spec/frontend/vue_shared/components/file_finder/index_spec.js
View file @
02a5462b
...
@@ -154,6 +154,16 @@ describe('File finder item spec', () => {
...
@@ -154,6 +154,16 @@ describe('File finder item spec', () => {
});
});
});
});
describe
(
'
DOM Performance
'
,
()
=>
{
it
(
'
renders less DOM nodes if not visible by utilizing v-if
'
,
async
()
=>
{
vm
.
visible
=
false
;
await
waitForPromises
();
expect
(
vm
.
$el
).
toBeInstanceOf
(
Comment
);
});
});
describe
(
'
watches
'
,
()
=>
{
describe
(
'
watches
'
,
()
=>
{
describe
(
'
searchText
'
,
()
=>
{
describe
(
'
searchText
'
,
()
=>
{
it
(
'
resets focusedIndex when updated
'
,
(
done
)
=>
{
it
(
'
resets focusedIndex when updated
'
,
(
done
)
=>
{
...
@@ -169,7 +179,7 @@ describe('File finder item spec', () => {
...
@@ -169,7 +179,7 @@ describe('File finder item spec', () => {
});
});
describe
(
'
visible
'
,
()
=>
{
describe
(
'
visible
'
,
()
=>
{
it
(
'
re
turns searchText when
false
'
,
(
done
)
=>
{
it
(
'
re
sets searchText when changed to
false
'
,
(
done
)
=>
{
vm
.
searchText
=
'
test
'
;
vm
.
searchText
=
'
test
'
;
vm
.
visible
=
true
;
vm
.
visible
=
true
;
...
...
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