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
Jérome Perrin
gitlab-ce
Commits
1eb3e8ac
Commit
1eb3e8ac
authored
8 years ago
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes bug with commenting on merge requests
parent
0e344aa2
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
app/assets/javascripts/merge_request.js.coffee
app/assets/javascripts/merge_request.js.coffee
+7
-6
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+4
-0
No files found.
app/assets/javascripts/merge_request.js.coffee
View file @
1eb3e8ac
...
@@ -48,14 +48,15 @@ class @MergeRequest
...
@@ -48,14 +48,15 @@ class @MergeRequest
_this
=
@
_this
=
@
$
(
'a.btn-close, a.btn-reopen'
).
on
'click'
,
(
e
)
->
$
(
'a.btn-close, a.btn-reopen'
).
on
'click'
,
(
e
)
->
$this
=
$
(
this
)
$this
=
$
(
this
)
if
$this
.
data
(
'submitted'
)
return
e
.
preventDefault
()
e
.
stopImmediatePropagation
()
shouldSubmit
=
$this
.
hasClass
(
'btn-comment'
)
shouldSubmit
=
$this
.
hasClass
(
'btn-comment'
)
console
.
log
(
"shouldSubmit"
)
if
shouldSubmit
&&
$this
.
data
(
'submitted'
)
return
if
shouldSubmit
if
shouldSubmit
_this
.
submitNoteForm
(
$this
.
closest
(
'form'
),
$this
)
if
$this
.
hasClass
(
'btn-comment-and-close'
)
||
$this
.
hasClass
(
'btn-comment-and-reopen'
)
e
.
preventDefault
()
e
.
stopImmediatePropagation
()
_this
.
submitNoteForm
(
$this
.
closest
(
'form'
),
$this
)
submitNoteForm
:
(
form
,
$button
)
=>
submitNoteForm
:
(
form
,
$button
)
=>
noteText
=
form
.
find
(
"textarea.js-note-text"
).
val
()
noteText
=
form
.
find
(
"textarea.js-note-text"
).
val
()
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/notes.js.coffee
View file @
1eb3e8ac
...
@@ -521,9 +521,13 @@ class @Notes
...
@@ -521,9 +521,13 @@ class @Notes
if
textarea
.
val
().
trim
().
length
>
0
if
textarea
.
val
().
trim
().
length
>
0
form
.
find
(
'.js-note-target-reopen'
).
text
(
'Comment & reopen'
)
form
.
find
(
'.js-note-target-reopen'
).
text
(
'Comment & reopen'
)
form
.
find
(
'.js-note-target-close'
).
text
(
'Comment & close'
)
form
.
find
(
'.js-note-target-close'
).
text
(
'Comment & close'
)
form
.
find
(
'.js-note-target-reopen'
).
addClass
(
'btn-comment-and-reopen'
)
form
.
find
(
'.js-note-target-close'
).
addClass
(
'btn-comment-and-close'
)
else
else
form
.
find
(
'.js-note-target-reopen'
).
text
(
'Reopen'
)
form
.
find
(
'.js-note-target-reopen'
).
text
(
'Reopen'
)
form
.
find
(
'.js-note-target-close'
).
text
(
'Close'
)
form
.
find
(
'.js-note-target-close'
).
text
(
'Close'
)
form
.
find
(
'.js-note-target-reopen'
).
removeClass
(
'btn-comment-and-reopen'
)
form
.
find
(
'.js-note-target-close'
).
removeClass
(
'btn-comment-and-close'
)
initTaskList
:
->
initTaskList
:
->
@
enableTaskList
()
@
enableTaskList
()
...
...
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