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
Jérome Perrin
gitlab-ce
Commits
b05092ef
Commit
b05092ef
authored
Jul 18, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move ideEl and monacoInstance to Store from 'self' or helper
parent
87b9af80
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
app/assets/javascripts/repo/repo_editor.js
app/assets/javascripts/repo/repo_editor.js
+11
-11
app/assets/javascripts/repo/repo_helper.js
app/assets/javascripts/repo/repo_helper.js
+0
-2
app/assets/javascripts/repo/repo_store.js
app/assets/javascripts/repo/repo_store.js
+2
-0
No files found.
app/assets/javascripts/repo/repo_editor.js
View file @
b05092ef
...
...
@@ -7,7 +7,7 @@ import monacoLoader from './monaco_loader';
export
default
class
RepoEditor
{
constructor
(
el
)
{
this
.
initMonaco
();
this
.
e
l
=
el
;
Store
.
ideE
l
=
el
;
}
addMonacoEvents
()
{
...
...
@@ -21,26 +21,26 @@ export default class RepoEditor {
initMonaco
()
{
monacoLoader
([
'
vs/editor/editor.main
'
],
()
=>
{
this
.
monacoEditor
=
monaco
.
editor
.
create
(
this
.
e
l
,
{
this
.
monacoEditor
=
monaco
.
editor
.
create
(
Store
.
ideE
l
,
{
model
:
null
,
readOnly
:
true
,
contextmenu
:
false
,
});
Helper
.
monacoInstance
=
monaco
;
Store
.
monacoInstance
=
this
.
monacoEditor
;
this
.
initVue
();
this
.
addMonacoEvents
();
});
}
initVue
()
{
const
self
=
this
;
this
.
vue
=
new
Vue
({
data
:
()
=>
Store
,
created
()
{
this
.
showHide
();
if
(
this
.
blobRaw
!==
''
)
{
self
.
monacoEditor
.
setModel
(
this
.
monacoInstance
.
setModel
(
monaco
.
editor
.
createModel
(
this
.
blobRaw
,
'
plain
'
,
...
...
@@ -52,16 +52,16 @@ export default class RepoEditor {
methods
:
{
showHide
()
{
if
(
!
this
.
openedFiles
.
length
||
(
this
.
binary
&&
!
this
.
activeFile
.
raw
))
{
self
.
e
l
.
style
.
display
=
'
none
'
;
this
.
ideE
l
.
style
.
display
=
'
none
'
;
}
else
{
self
.
e
l
.
style
.
display
=
'
inline-block
'
;
this
.
ideE
l
.
style
.
display
=
'
inline-block
'
;
}
},
},
watch
:
{
activeLine
()
{
self
.
monacoEditor
.
setPosition
({
this
.
monacoInstance
.
setPosition
({
lineNumber
:
this
.
activeLine
,
column
:
1
,
});
...
...
@@ -78,7 +78,7 @@ export default class RepoEditor {
readOnly
=
true
;
}
self
.
monacoEditor
.
updateOptions
({
this
.
monacoInstance
.
updateOptions
({
readOnly
,
});
},
...
...
@@ -104,9 +104,9 @@ export default class RepoEditor {
if
(
!
this
.
isTree
)
{
// kill the current model;
self
.
monacoEditor
.
setModel
(
null
);
this
.
monacoInstance
.
setModel
(
null
);
// then create the new one
self
.
monacoEditor
.
setModel
(
this
.
monacoInstance
.
setModel
(
monaco
.
editor
.
createModel
(
this
.
blobRaw
,
Helper
...
...
app/assets/javascripts/repo/repo_helper.js
View file @
b05092ef
...
...
@@ -8,8 +8,6 @@ const RepoHelper = {
return
Object
.
hasOwnProperty
.
call
(
data
,
'
blobs
'
);
},
monacoInstance
:
undefined
,
Time
:
window
.
performance
&&
window
.
performance
.
now
?
window
.
performance
...
...
app/assets/javascripts/repo/repo_store.js
View file @
b05092ef
const
RepoStore
=
{
ideEl
:
{},
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