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
765cca93
Commit
765cca93
authored
Mar 30, 2020
by
lauraMon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaces underscore with lodash in ds
parent
3cf78b50
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
app/assets/javascripts/dirty_submit/dirty_submit_form.js
app/assets/javascripts/dirty_submit/dirty_submit_form.js
+3
-3
spec/javascripts/dirty_submit/dirty_submit_form_spec.js
spec/javascripts/dirty_submit/dirty_submit_form_spec.js
+1
-0
No files found.
app/assets/javascripts/dirty_submit/dirty_submit_form.js
View file @
765cca93
import
_
from
'
underscore
'
;
import
{
memoize
,
throttle
}
from
'
lodash
'
;
import
$
from
'
jquery
'
;
class
DirtySubmitForm
{
...
...
@@ -21,8 +21,8 @@ class DirtySubmitForm {
}
registerListeners
()
{
const
getThrottledHandlerForInput
=
_
.
memoize
(()
=>
_
.
throttle
(
event
=>
this
.
updateDirtyInput
(
event
),
DirtySubmitForm
.
THROTTLE_DURATION
),
const
getThrottledHandlerForInput
=
memoize
(()
=>
throttle
(
event
=>
this
.
updateDirtyInput
(
event
),
DirtySubmitForm
.
THROTTLE_DURATION
),
);
const
throttledUpdateDirtyInput
=
event
=>
{
...
...
spec/javascripts/dirty_submit/dirty_submit_form_spec.js
View file @
765cca93
...
...
@@ -70,6 +70,7 @@ describe('DirtySubmitForm', () => {
describe
(
'
throttling tests
'
,
()
=>
{
beforeEach
(()
=>
{
jasmine
.
clock
().
install
();
jasmine
.
clock
().
mockDate
();
DirtySubmitForm
.
THROTTLE_DURATION
=
100
;
});
...
...
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