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
caa1ccfb
Commit
caa1ccfb
authored
Feb 03, 2021
by
Denys Mishunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed 'diff' to 'isDiff'
Done to highlight its boolean nature. As per review
parent
8a9e379a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
app/assets/javascripts/editor/editor_lite.js
app/assets/javascripts/editor/editor_lite.js
+6
-6
spec/frontend/editor/editor_lite_spec.js
spec/frontend/editor/editor_lite_spec.js
+1
-1
No files found.
app/assets/javascripts/editor/editor_lite.js
View file @
caa1ccfb
...
...
@@ -110,7 +110,7 @@ export default class EditorLite {
blobOriginalContent
,
blobGlobalId
,
instance
,
d
iff
,
isD
iff
,
}
=
{})
{
if
(
!
instance
)
{
return
null
;
...
...
@@ -119,7 +119,7 @@ export default class EditorLite {
const
uri
=
Uri
.
file
(
uriFilePath
);
const
existingModel
=
monacoEditor
.
getModel
(
uri
);
const
model
=
existingModel
||
monacoEditor
.
createModel
(
blobContent
,
undefined
,
uri
);
if
(
!
d
iff
)
{
if
(
!
isD
iff
)
{
instance
.
setModel
(
model
);
return
model
;
}
...
...
@@ -198,12 +198,12 @@ export default class EditorLite {
blobOriginalContent
=
''
,
blobGlobalId
=
uuids
()[
0
],
extensions
=
[],
d
iff
=
false
,
isD
iff
=
false
,
...
instanceOptions
}
=
{})
{
EditorLite
.
prepareInstance
(
el
);
const
createEditorFn
=
d
iff
?
'
createDiffEditor
'
:
'
create
'
;
const
createEditorFn
=
isD
iff
?
'
createDiffEditor
'
:
'
create
'
;
const
instance
=
EditorLite
.
convertMonacoToELInstance
(
monacoEditor
[
createEditorFn
].
call
(
this
,
el
,
{
...
this
.
options
,
...
...
@@ -219,7 +219,7 @@ export default class EditorLite {
blobPath
,
blobContent
,
instance
,
d
iff
,
isD
iff
,
});
}
...
...
@@ -237,7 +237,7 @@ export default class EditorLite {
createDiffInstance
(
args
)
{
return
this
.
createInstance
({
...
args
,
d
iff
:
true
,
isD
iff
:
true
,
});
}
...
...
spec/frontend/editor/editor_lite_spec.js
View file @
caa1ccfb
...
...
@@ -178,7 +178,7 @@ describe('Base editor', () => {
editor
.
createDiffInstance
();
expect
(
spy
).
toHaveBeenCalledWith
(
expect
.
objectContaining
({
d
iff
:
true
,
isD
iff
:
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