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
e3c9db3f
Commit
e3c9db3f
authored
Jun 08, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor monaco-editor import and stop storing as class property within model
parent
4653820d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
app/assets/javascripts/ide/lib/common/model.js
app/assets/javascripts/ide/lib/common/model.js
+7
-8
No files found.
app/assets/javascripts/ide/lib/common/model.js
View file @
e3c9db3f
import
*
as
monaco
from
'
monaco-editor
'
;
import
{
editor
as
monacoEditor
,
Uri
as
monacoUri
}
from
'
monaco-editor
'
;
import
Disposable
from
'
./disposable
'
;
import
eventHub
from
'
../../eventhub
'
;
export
default
class
Model
{
constructor
(
file
,
head
=
null
)
{
this
.
monaco
=
monaco
;
this
.
disposable
=
new
Disposable
();
this
.
file
=
file
;
this
.
head
=
head
;
this
.
content
=
file
.
content
!==
''
?
file
.
content
:
file
.
raw
;
this
.
disposable
.
add
(
(
this
.
originalModel
=
this
.
monaco
.
e
ditor
.
createModel
(
(
this
.
originalModel
=
monacoE
ditor
.
createModel
(
head
?
head
.
content
:
this
.
file
.
raw
,
undefined
,
new
this
.
monaco
.
Uri
(
false
,
false
,
`original/
${
this
.
path
}
`
),
new
monaco
Uri
(
false
,
false
,
`original/
${
this
.
path
}
`
),
)),
(
this
.
model
=
this
.
monaco
.
e
ditor
.
createModel
(
(
this
.
model
=
monacoE
ditor
.
createModel
(
this
.
content
,
undefined
,
new
this
.
monaco
.
Uri
(
false
,
false
,
this
.
path
),
new
monaco
Uri
(
false
,
false
,
this
.
path
),
)),
);
if
(
this
.
file
.
mrChange
)
{
this
.
disposable
.
add
(
(
this
.
baseModel
=
this
.
monaco
.
e
ditor
.
createModel
(
(
this
.
baseModel
=
monacoE
ditor
.
createModel
(
this
.
file
.
baseRaw
,
undefined
,
new
this
.
monaco
.
Uri
(
false
,
false
,
`target/
${
this
.
path
}
`
),
new
monaco
Uri
(
false
,
false
,
`target/
${
this
.
path
}
`
),
)),
);
}
...
...
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