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
37b7ce48
Commit
37b7ce48
authored
Aug 09, 2017
by
Jacob Schatz
Committed by
Eric Eastwood
Aug 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move monaco instance to helper so it doesn't get recursively tracked.
parent
46ce53da
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
app/assets/javascripts/repo/components/repo_editor.vue
app/assets/javascripts/repo/components/repo_editor.vue
+10
-10
app/assets/javascripts/repo/helpers/repo_helper.js
app/assets/javascripts/repo/helpers/repo_helper.js
+2
-0
app/assets/javascripts/repo/stores/repo_store.js
app/assets/javascripts/repo/stores/repo_store.js
+0
-1
No files found.
app/assets/javascripts/repo/components/repo_editor.vue
View file @
37b7ce48
...
...
@@ -8,8 +8,8 @@ const RepoEditor = {
data
:
()
=>
Store
,
destroyed
()
{
if
(
this
.
monacoInstance
){
this
.
monacoInstance
.
destroy
();
if
(
Helper
.
monacoInstance
){
Helper
.
monacoInstance
.
destroy
();
}
},
...
...
@@ -25,7 +25,7 @@ const RepoEditor = {
contextmenu
:
false
,
});
Store
.
monacoInstance
=
monacoInstance
;
Helper
.
monacoInstance
=
monacoInstance
;
this
.
addMonacoEvents
();
...
...
@@ -34,7 +34,7 @@ const RepoEditor = {
this
.
showHide
();
const
newModel
=
this
.
monaco
.
editor
.
createModel
(
this
.
blobRaw
,
languageID
);
this
.
monacoInstance
.
setModel
(
newModel
);
Helper
.
monacoInstance
.
setModel
(
newModel
);
}).
catch
(
Helper
.
loadingError
);
},
...
...
@@ -48,12 +48,12 @@ const RepoEditor = {
},
addMonacoEvents
()
{
this
.
monacoInstance
.
onMouseUp
(
this
.
onMonacoEditorMouseUp
);
this
.
monacoInstance
.
onKeyUp
(
this
.
onMonacoEditorKeysPressed
.
bind
(
this
));
Helper
.
monacoInstance
.
onMouseUp
(
this
.
onMonacoEditorMouseUp
);
Helper
.
monacoInstance
.
onKeyUp
(
this
.
onMonacoEditorKeysPressed
.
bind
(
this
));
},
onMonacoEditorKeysPressed
()
{
Store
.
setActiveFileContents
(
this
.
monacoInstance
.
getValue
());
Store
.
setActiveFileContents
(
Helper
.
monacoInstance
.
getValue
());
},
onMonacoEditorMouseUp
(
e
)
{
...
...
@@ -67,7 +67,7 @@ const RepoEditor = {
watch
:
{
activeLine
()
{
this
.
monacoInstance
.
setPosition
({
Helper
.
monacoInstance
.
setPosition
({
lineNumber
:
this
.
activeLine
,
column
:
1
,
});
...
...
@@ -115,13 +115,13 @@ const RepoEditor = {
if
(
this
.
isTree
)
return
;
this
.
monacoInstance
.
setModel
(
null
);
Helper
.
monacoInstance
.
setModel
(
null
);
const
languages
=
this
.
monaco
.
languages
.
getLanguages
();
const
languageID
=
Helper
.
getLanguageIDForFile
(
this
.
activeFile
,
languages
);
const
newModel
=
this
.
monaco
.
editor
.
createModel
(
this
.
blobRaw
,
languageID
);
this
.
monacoInstance
.
setModel
(
newModel
);
Helper
.
monacoInstance
.
setModel
(
newModel
);
},
},
};
...
...
app/assets/javascripts/repo/helpers/repo_helper.js
View file @
37b7ce48
...
...
@@ -4,6 +4,8 @@ import Store from '../stores/repo_store';
import
'
../../flash
'
;
const
RepoHelper
=
{
monacoInstance
:
{},
getDefaultActiveFile
()
{
return
{
active
:
true
,
...
...
app/assets/javascripts/repo/stores/repo_store.js
View file @
37b7ce48
...
...
@@ -6,7 +6,6 @@ const RepoStore = {
ideEl
:
{},
monaco
:
{},
monacoLoading
:
false
,
monacoInstance
:
{},
service
:
''
,
editor
:
''
,
sidebar
:
''
,
...
...
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