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
9cd0bb74
Commit
9cd0bb74
authored
Mar 28, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change IDE diff view responsively
Closes #44305
parent
32d2206b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
+20
-5
app/assets/javascripts/ide/components/repo_editor.vue
app/assets/javascripts/ide/components/repo_editor.vue
+6
-4
app/assets/javascripts/ide/lib/editor.js
app/assets/javascripts/ide/lib/editor.js
+14
-1
No files found.
app/assets/javascripts/ide/components/repo_editor.vue
View file @
9cd0bb74
...
...
@@ -13,7 +13,7 @@ export default {
},
},
computed
:
{
...
mapState
([
'
leftPanelCollapsed
'
,
'
rightPanelCollapsed
'
,
'
viewer
'
,
'
delayViewerUpdated
'
]),
...
mapState
([
'
rightPanelCollapsed
'
,
'
viewer
'
,
'
delayViewerUpdated
'
,
'
panelResizing
'
]),
...
mapGetters
([
'
currentMergeRequest
'
]),
shouldHideEditor
()
{
return
this
.
file
&&
this
.
file
.
binary
&&
!
this
.
file
.
raw
;
...
...
@@ -26,15 +26,17 @@ export default {
this
.
initMonaco
();
}
},
leftPanelCollapsed
()
{
this
.
editor
.
updateDimensions
();
},
rightPanelCollapsed
()
{
this
.
editor
.
updateDimensions
();
},
viewer
()
{
this
.
createEditorInstance
();
},
panelResizing
()
{
if
(
!
this
.
panelResizing
)
{
this
.
editor
.
updateDimensions
();
}
},
},
beforeDestroy
()
{
this
.
editor
.
dispose
();
...
...
app/assets/javascripts/ide/lib/editor.js
View file @
9cd0bb74
...
...
@@ -81,7 +81,7 @@ export default class Editor {
}
attachModel
(
model
)
{
if
(
this
.
i
nstance
.
getEditorType
()
===
'
vs.editor.IDiffEditor
'
)
{
if
(
this
.
i
sDiffEditorType
)
{
this
.
instance
.
setModel
({
original
:
model
.
getOriginalModel
(),
modified
:
model
.
getModel
(),
...
...
@@ -153,6 +153,7 @@ export default class Editor {
updateDimensions
()
{
this
.
instance
.
layout
();
this
.
updateDiffView
();
}
setPosition
({
lineNumber
,
column
})
{
...
...
@@ -171,4 +172,16 @@ export default class Editor {
this
.
disposable
.
add
(
this
.
instance
.
onDidChangeCursorPosition
(
e
=>
cb
(
this
.
instance
,
e
)));
}
updateDiffView
()
{
if
(
!
this
.
isDiffEditorType
)
return
;
this
.
instance
.
updateOptions
({
renderSideBySide
:
this
.
instance
.
getDomNode
().
offsetWidth
>=
700
,
});
}
get
isDiffEditorType
()
{
return
this
.
instance
.
getEditorType
()
===
'
vs.editor.IDiffEditor
'
;
}
}
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