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
015e69ad
Commit
015e69ad
authored
Oct 08, 2020
by
Denys Mishunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Abstracted debounce into a constant
parent
dc8ad68c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
app/assets/javascripts/editor/constants.js
app/assets/javascripts/editor/constants.js
+1
-0
app/assets/javascripts/vue_shared/components/editor_lite.vue
app/assets/javascripts/vue_shared/components/editor_lite.vue
+4
-1
No files found.
app/assets/javascripts/editor/constants.js
View file @
015e69ad
...
...
@@ -5,3 +5,4 @@ export const EDITOR_LITE_INSTANCE_ERROR_NO_EL = __(
);
export
const
URI_PREFIX
=
'
gitlab
'
;
export
const
CONTENT_UPDATE_DEBOUNCE
=
250
;
app/assets/javascripts/vue_shared/components/editor_lite.vue
View file @
015e69ad
<
script
>
import
{
debounce
}
from
'
lodash
'
;
import
Editor
from
'
~/editor/editor_lite
'
;
import
{
CONTENT_UPDATE_DEBOUNCE
}
from
'
~/editor/constants
'
;
function
initEditorLite
({
el
,
...
args
})
{
const
editor
=
new
Editor
({
...
...
@@ -67,7 +68,9 @@ export default {
...
this
.
editorOptions
,
});
this
.
editor
.
onDidChangeModelContent
(
debounce
(
this
.
onFileChange
.
bind
(
this
),
250
));
this
.
editor
.
onDidChangeModelContent
(
debounce
(
this
.
onFileChange
.
bind
(
this
),
CONTENT_UPDATE_DEBOUNCE
),
);
},
beforeDestroy
()
{
this
.
editor
.
dispose
();
...
...
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