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
b72f52f1
Commit
b72f52f1
authored
6 years ago
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable tasklist items while request is being done
parent
515f4b46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
app/assets/javascripts/task_list.js
app/assets/javascripts/task_list.js
+18
-2
No files found.
app/assets/javascripts/task_list.js
View file @
b72f52f1
...
@@ -34,8 +34,16 @@ export default class TaskList {
...
@@ -34,8 +34,16 @@ export default class TaskList {
);
);
}
}
disable
()
{
disable
TaskListItems
()
{
$
(
`
${
this
.
selector
}
.js-task-list-container`
).
taskList
(
'
disable
'
);
$
(
`
${
this
.
selector
}
.js-task-list-container`
).
taskList
(
'
disable
'
);
}
enableTaskListItems
()
{
$
(
`
${
this
.
selector
}
.js-task-list-container`
).
taskList
(
'
enable
'
);
}
disable
()
{
this
.
disableTaskListItems
();
$
(
document
).
off
(
'
tasklist:changed
'
,
`
${
this
.
selector
}
.js-task-list-container`
);
$
(
document
).
off
(
'
tasklist:changed
'
,
`
${
this
.
selector
}
.js-task-list-container`
);
}
}
...
@@ -47,12 +55,20 @@ export default class TaskList {
...
@@ -47,12 +55,20 @@ export default class TaskList {
lock_version
:
this
.
lockVersion
,
lock_version
:
this
.
lockVersion
,
};
};
this
.
disableTaskListItems
();
return
axios
return
axios
.
patch
(
$target
.
data
(
'
updateUrl
'
)
||
$
(
'
form.js-issuable-update
'
).
attr
(
'
action
'
),
patchData
)
.
patch
(
$target
.
data
(
'
updateUrl
'
)
||
$
(
'
form.js-issuable-update
'
).
attr
(
'
action
'
),
patchData
)
.
catch
(({
response
})
=>
this
.
onError
(
response
.
data
));
.
then
(({
data
})
=>
{
.
then
(({
data
})
=>
{
this
.
lockVersion
=
data
.
lock_version
;
this
.
lockVersion
=
data
.
lock_version
;
this
.
enableTaskListItems
();
return
this
.
onSuccess
(
data
);
return
this
.
onSuccess
(
data
);
})
})
.
catch
(({
response
})
=>
{
this
.
enableTaskListItems
();
return
this
.
onError
(
response
.
data
);
});
}
}
}
}
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