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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
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
Changes
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