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
3dbbe26b
Commit
3dbbe26b
authored
4 years ago
by
Denys Mishunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed mutation of instance
Now we use Proxy pattern instead of a decorator
parent
caa1ccfb
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
app/assets/javascripts/editor/editor_lite.js
app/assets/javascripts/editor/editor_lite.js
+15
-6
No files found.
app/assets/javascripts/editor/editor_lite.js
View file @
3dbbe26b
...
...
@@ -135,14 +135,23 @@ export default class EditorLite {
}
static
convertMonacoToELInstance
=
(
inst
)
=>
{
this
.
instance
=
inst
;
this
.
instance
.
updateModelLanguage
=
(
path
)
=>
{
const
editorLiteInstanceAPI
=
{
updateModelLanguage
:
(
path
)
=>
{
return
EditorLite
.
instanceUpdateLanguage
(
inst
,
path
);
};
this
.
instance
.
use
=
(
exts
=
[])
=>
{
},
use
:
(
exts
=
[])
=>
{
return
EditorLite
.
instanceApplyExtension
(
inst
,
exts
);
},
};
const
handler
=
{
get
(
target
,
prop
,
receiver
)
{
if
(
Reflect
.
has
(
editorLiteInstanceAPI
,
prop
))
{
return
editorLiteInstanceAPI
[
prop
];
}
return
Reflect
.
get
(
target
,
prop
,
receiver
);
},
};
return
this
.
instance
;
return
new
Proxy
(
inst
,
handler
)
;
};
static
instanceUpdateLanguage
(
inst
,
path
)
{
...
...
This diff is collapsed.
Click to expand it.
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