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
efb62337
Commit
efb62337
authored
Aug 14, 2017
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Protect against uninitialized monacoInstance
parent
335d0b96
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
app/assets/javascripts/repo/components/repo_editor.vue
app/assets/javascripts/repo/components/repo_editor.vue
+11
-7
app/assets/javascripts/repo/helpers/repo_helper.js
app/assets/javascripts/repo/helpers/repo_helper.js
+1
-1
No files found.
app/assets/javascripts/repo/components/repo_editor.vue
View file @
efb62337
...
...
@@ -29,14 +29,19 @@ const RepoEditor = {
this
.
addMonacoEvents
();
Helper
.
setMonacoModelFromLanguage
();
this
.
showHide
();
this
.
setupEditor
();
})
.
catch
(
Helper
.
loadingError
);
},
methods
:
{
setupEditor
()
{
this
.
showHide
();
if
(
this
.
isTree
)
return
;
Helper
.
setMonacoModelFromLanguage
();
},
showHide
()
{
if
(
!
this
.
openedFiles
.
length
||
(
this
.
binary
&&
!
this
.
activeFile
.
raw
))
{
this
.
$el
.
style
.
display
=
'
none
'
;
...
...
@@ -109,10 +114,9 @@ const RepoEditor = {
},
blobRaw
()
{
this
.
showHide
();
if
(
this
.
isTree
)
return
;
Helper
.
setMonacoModelFromLanguage
();
if
(
Helper
.
monacoInstance
)
{
this
.
setupEditor
();
}
},
},
};
...
...
app/assets/javascripts/repo/helpers/repo_helper.js
View file @
efb62337
...
...
@@ -4,7 +4,7 @@ import Store from '../stores/repo_store';
import
'
../../flash
'
;
const
RepoHelper
=
{
monacoInstance
:
{}
,
monacoInstance
:
null
,
getDefaultActiveFile
()
{
return
{
...
...
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