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
aa3ff56c
Commit
aa3ff56c
authored
Aug 23, 2017
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IssueNotesRefactor: Empty textarea while submitting comment and restore content if request fails.
parent
fa482111
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
app/assets/javascripts/notes/components/issue_comment_form.vue
...ssets/javascripts/notes/components/issue_comment_form.vue
+4
-5
No files found.
app/assets/javascripts/notes/components/issue_comment_form.vue
View file @
aa3ff56c
...
@@ -123,6 +123,7 @@
...
@@ -123,6 +123,7 @@
noteData
.
data
.
note
.
type
=
constants
.
DISCUSSION_NOTE
;
noteData
.
data
.
note
.
type
=
constants
.
DISCUSSION_NOTE
;
}
}
this
.
isSubmitting
=
true
;
this
.
isSubmitting
=
true
;
this
.
note
=
''
;
// Empty textarea while being requested. Repopulate in catch
this
.
saveNote
(
noteData
)
this
.
saveNote
(
noteData
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
...
@@ -148,11 +149,9 @@
...
@@ -148,11 +149,9 @@
.
catch
(()
=>
{
.
catch
(()
=>
{
this
.
isSubmitting
=
false
;
this
.
isSubmitting
=
false
;
this
.
discard
(
false
);
this
.
discard
(
false
);
Flash
(
const
msg
=
'
Your comment could not be submitted! Please check your network connection and try again.
'
;
'
Your comment could not be submitted! Please check your network connection and try again.
'
,
Flash
(
msg
,
'
alert
'
,
$
(
this
.
$el
));
'
alert
'
,
this
.
note
=
noteData
.
data
.
note
.
note
;
// Restore textarea content.
$
(
this
.
$el
),
);
this
.
removePlaceholderNotes
();
this
.
removePlaceholderNotes
();
});
});
}
else
{
}
else
{
...
...
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