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
Hide 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 {
...
@@ -52,10 +52,16 @@ export default {
handleToggle
()
{
handleToggle
()
{
const
{
collapsed
,
highlightedDiffLines
,
parallelDiffLines
}
=
this
.
file
;
const
{
collapsed
,
highlightedDiffLines
,
parallelDiffLines
}
=
this
.
file
;
if
(
collapsed
&&
!
highlightedDiffLines
&&
!
parallelDiffLines
.
length
)
{
if
(
collapsed
&&
!
highlightedDiffLines
&&
parallelDiffLines
!==
undefined
&&
!
parallelDiffLines
.
length
)
{
this
.
handleLoadCollapsedDiff
();
this
.
handleLoadCollapsedDiff
();
}
else
{
}
else
{
this
.
file
.
collapsed
=
!
this
.
file
.
collapsed
;
this
.
file
.
collapsed
=
!
this
.
file
.
collapsed
;
this
.
file
.
renderIt
=
true
;
}
}
},
},
handleLoadCollapsedDiff
()
{
handleLoadCollapsedDiff
()
{
...
@@ -65,6 +71,7 @@ export default {
...
@@ -65,6 +71,7 @@ export default {
.
then
(()
=>
{
.
then
(()
=>
{
this
.
isLoadingCollapsedDiff
=
false
;
this
.
isLoadingCollapsedDiff
=
false
;
this
.
file
.
collapsed
=
false
;
this
.
file
.
collapsed
=
false
;
this
.
file
.
renderIt
=
true
;
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
this
.
isLoadingCollapsedDiff
=
false
;
this
.
isLoadingCollapsedDiff
=
false
;
...
...
app/assets/javascripts/diffs/store/actions.js
View file @
64d0f1e2
...
@@ -31,7 +31,9 @@ export const fetchDiffFiles = ({ state, commit }) => {
...
@@ -31,7 +31,9 @@ export const fetchDiffFiles = ({ state, commit }) => {
export
const
startRenderDiffsQueue
=
({
state
,
commit
})
=>
{
export
const
startRenderDiffsQueue
=
({
state
,
commit
})
=>
{
const
checkItem
=
()
=>
{
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
)
{
if
(
nextFile
)
{
requestAnimationFrame
(()
=>
{
requestAnimationFrame
(()
=>
{
commit
(
types
.
RENDER_FILE
,
nextFile
);
commit
(
types
.
RENDER_FILE
,
nextFile
);
...
...
app/assets/javascripts/diffs/store/mutations.js
View file @
64d0f1e2
...
@@ -21,26 +21,26 @@ export default {
...
@@ -21,26 +21,26 @@ export default {
if
(
file
.
parallelDiffLines
)
{
if
(
file
.
parallelDiffLines
)
{
file
.
parallelDiffLines
.
forEach
(
line
=>
{
file
.
parallelDiffLines
.
forEach
(
line
=>
{
// eslint-disable-next-line no-param-reassign
// 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
)
{
if
(
file
.
highlightedDiffLines
)
{
file
.
highlightedDiffLines
.
forEach
(
line
=>
{
file
.
highlightedDiffLines
.
forEach
(
line
=>
{
// eslint-disable-next-line no-param-reassign
// eslint-disable-next-line no-param-reassign
if
(
line
.
left
)
delete
line
.
left
.
text
;
delete
line
.
text
;
// eslint-disable-next-line no-param-reassign
if
(
line
.
right
)
delete
line
.
right
.
text
;
});
});
}
}
if
(
file
.
highlightedDiffLines
)
{
if
(
file
.
highlightedDiffLines
)
{
showingLines
+=
file
.
parallelDiffLines
.
length
;
showingLines
+=
file
.
parallelDiffLines
.
length
;
Object
.
assign
(
file
,
{
renderIt
:
showingLines
<
200
,
collapsed
:
showingLines
>
2000
,
});
}
}
Object
.
assign
(
file
,
{
renderIt
:
showingLines
<
200
,
collapsed
:
file
.
text
&&
showingLines
>
2000
,
});
});
});
Object
.
assign
(
state
,
{
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