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
94bb7feb
Commit
94bb7feb
authored
Aug 12, 2017
by
Jacob Schatz
Committed by
Eric Eastwood
Aug 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move monaco from Store to Helper.
parent
f0ee82f0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
app/assets/javascripts/repo/components/repo_editor.vue
app/assets/javascripts/repo/components/repo_editor.vue
+1
-1
app/assets/javascripts/repo/helpers/monaco_loader_helper.js
app/assets/javascripts/repo/helpers/monaco_loader_helper.js
+2
-1
app/assets/javascripts/repo/helpers/repo_helper.js
app/assets/javascripts/repo/helpers/repo_helper.js
+2
-2
No files found.
app/assets/javascripts/repo/components/repo_editor.vue
View file @
94bb7feb
...
...
@@ -19,7 +19,7 @@ const RepoEditor = {
Store
.
blobRaw
=
rawResponse
.
data
;
Store
.
activeFile
.
plain
=
rawResponse
.
data
;
const
monacoInstance
=
this
.
monaco
.
editor
.
create
(
this
.
$el
,
{
const
monacoInstance
=
Helper
.
monaco
.
editor
.
create
(
this
.
$el
,
{
model
:
null
,
readOnly
:
false
,
contextmenu
:
false
,
...
...
app/assets/javascripts/repo/helpers/monaco_loader_helper.js
View file @
94bb7feb
/* global monaco */
import
RepoEditor
from
'
../components/repo_editor.vue
'
;
import
Store
from
'
../stores/repo_store
'
;
import
Helper
from
'
../helpers/repo_helper
'
;
import
monacoLoader
from
'
../monaco_loader
'
;
function
repoEditorLoader
()
{
Store
.
monacoLoading
=
true
;
return
new
Promise
((
resolve
,
reject
)
=>
{
monacoLoader
([
'
vs/editor/editor.main
'
],
()
=>
{
Store
.
monaco
=
monaco
;
Helper
.
monaco
=
monaco
;
Store
.
monacoLoading
=
false
;
resolve
(
RepoEditor
);
},
reject
);
...
...
app/assets/javascripts/repo/helpers/repo_helper.js
View file @
94bb7feb
...
...
@@ -48,9 +48,9 @@ const RepoHelper = {
setMonacoModelFromLanguage
()
{
RepoHelper
.
monacoInstance
.
setModel
(
null
);
const
languages
=
Store
.
monaco
.
languages
.
getLanguages
();
const
languages
=
RepoHelper
.
monaco
.
languages
.
getLanguages
();
const
languageID
=
RepoHelper
.
getLanguageIDForFile
(
Store
.
activeFile
,
languages
);
const
newModel
=
Store
.
monaco
.
editor
.
createModel
(
Store
.
blobRaw
,
languageID
);
const
newModel
=
RepoHelper
.
monaco
.
editor
.
createModel
(
Store
.
blobRaw
,
languageID
);
RepoHelper
.
monacoInstance
.
setModel
(
newModel
);
},
...
...
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