Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
GitLab FOSS
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
Container Registry
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GitLab.org
GitLab FOSS
Commits
32ce1e3a
Commit
32ce1e3a
authored
Mar 21, 2018
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disables the button when submitting comment.
parent
2025f361
Pipeline
#19278715
passed with stages
in 45 minutes and 56 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+3
-2
No files found.
app/assets/javascripts/notes.js
View file @
32ce1e3a
...
...
@@ -1727,6 +1727,7 @@ export default class Notes {
// Get Form metadata
const
$submitBtn
=
$
(
e
.
target
);
$submitBtn
.
prop
(
'
disabled
'
,
true
);
let
$form
=
$submitBtn
.
parents
(
'
form
'
);
const
$closeBtn
=
$form
.
find
(
'
.js-note-target-close
'
);
const
isDiscussionNote
=
...
...
@@ -1761,7 +1762,6 @@ export default class Notes {
// If comment is to resolve discussion, disable submit buttons while
// comment posting is finished.
if
(
isDiscussionResolve
)
{
$submitBtn
.
disable
();
$form
.
find
(
'
.js-comment-submit-button
'
).
disable
();
}
...
...
@@ -1816,6 +1816,7 @@ export default class Notes {
.
then
(
res
=>
{
const
note
=
res
.
data
;
$submitBtn
.
prop
(
'
disabled
'
,
false
);
// Submission successful! remove placeholder
$notesContainer
.
find
(
`#
${
noteUniqueId
}
`
).
remove
();
...
...
@@ -1899,7 +1900,7 @@ export default class Notes {
.
catch
(()
=>
{
// Submission failed, remove placeholder note and show Flash error message
$notesContainer
.
find
(
`#
${
noteUniqueId
}
`
).
remove
();
$submitBtn
.
prop
(
'
disabled
'
,
false
);
const
blurEvent
=
new
CustomEvent
(
'
blur.imageDiff
'
,
{
detail
:
e
,
});
...
...
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