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
Léo-Paul Géneau
gitlab-ce
Commits
64d0f1e2
Commit
64d0f1e2
authored
Aug 07, 2018
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed text removal memory saving + Fixed collapsed non text files
parent
de636f16
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
10 deletions
+19
-10
app/assets/javascripts/diffs/components/diff_file.vue
app/assets/javascripts/diffs/components/diff_file.vue
+8
-1
app/assets/javascripts/diffs/store/actions.js
app/assets/javascripts/diffs/store/actions.js
+3
-1
app/assets/javascripts/diffs/store/mutations.js
app/assets/javascripts/diffs/store/mutations.js
+8
-8
No files found.
app/assets/javascripts/diffs/components/diff_file.vue
View file @
64d0f1e2
...
...
@@ -52,10 +52,16 @@ export default {
handleToggle
()
{
const
{
collapsed
,
highlightedDiffLines
,
parallelDiffLines
}
=
this
.
file
;
if
(
collapsed
&&
!
highlightedDiffLines
&&
!
parallelDiffLines
.
length
)
{
if
(
collapsed
&&
!
highlightedDiffLines
&&
parallelDiffLines
!==
undefined
&&
!
parallelDiffLines
.
length
)
{
this
.
handleLoadCollapsedDiff
();
}
else
{
this
.
file
.
collapsed
=
!
this
.
file
.
collapsed
;
this
.
file
.
renderIt
=
true
;
}
},
handleLoadCollapsedDiff
()
{
...
...
@@ -65,6 +71,7 @@ export default {
.
then
(()
=>
{
this
.
isLoadingCollapsedDiff
=
false
;
this
.
file
.
collapsed
=
false
;
this
.
file
.
renderIt
=
true
;
})
.
catch
(()
=>
{
this
.
isLoadingCollapsedDiff
=
false
;
...
...
app/assets/javascripts/diffs/store/actions.js
View file @
64d0f1e2
...
...
@@ -31,7 +31,9 @@ export const fetchDiffFiles = ({ state, commit }) => {
export
const
startRenderDiffsQueue
=
({
state
,
commit
})
=>
{
const
checkItem
=
()
=>
{
const
nextFile
=
state
.
diffFiles
.
find
(
file
=>
!
file
.
renderIt
&&
!
file
.
collapsed
);
const
nextFile
=
state
.
diffFiles
.
find
(
file
=>
!
file
.
renderIt
&&
(
!
file
.
collapsed
||
!
file
.
text
),
);
if
(
nextFile
)
{
requestAnimationFrame
(()
=>
{
commit
(
types
.
RENDER_FILE
,
nextFile
);
...
...
app/assets/javascripts/diffs/store/mutations.js
View file @
64d0f1e2
...
...
@@ -21,26 +21,26 @@ export default {
if
(
file
.
parallelDiffLines
)
{
file
.
parallelDiffLines
.
forEach
(
line
=>
{
// eslint-disable-next-line no-param-reassign
delete
line
.
text
;
if
(
line
.
left
)
delete
line
.
left
.
text
;
// eslint-disable-next-line no-param-reassign
if
(
line
.
right
)
delete
line
.
right
.
text
;
});
}
if
(
file
.
highlightedDiffLines
)
{
file
.
highlightedDiffLines
.
forEach
(
line
=>
{
// eslint-disable-next-line no-param-reassign
if
(
line
.
left
)
delete
line
.
left
.
text
;
// eslint-disable-next-line no-param-reassign
if
(
line
.
right
)
delete
line
.
right
.
text
;
delete
line
.
text
;
});
}
if
(
file
.
highlightedDiffLines
)
{
showingLines
+=
file
.
parallelDiffLines
.
length
;
}
Object
.
assign
(
file
,
{
renderIt
:
showingLines
<
200
,
collapsed
:
showingLines
>
2000
,
collapsed
:
file
.
text
&&
showingLines
>
2000
,
});
}
});
Object
.
assign
(
state
,
{
...
...
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