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
5dd01f57
Commit
5dd01f57
authored
Apr 05, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Destroy discussion form
parent
82164a9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
app/assets/javascripts/gl_form.js.coffee
app/assets/javascripts/gl_form.js.coffee
+19
-3
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+3
-5
No files found.
app/assets/javascripts/gl_form.js.coffee
View file @
5dd01f57
class
@
GLForm
constructor
:
(
@
form
)
->
@
textarea
=
@
form
.
find
(
".js-note-text"
)
@
textarea
=
@
form
.
find
(
'.js-note-text'
)
@
setupForm
()
@
form
.
data
'gl-form'
,
@
destroy
:
->
# Destroy actions
actions
=
@
form
.
data
'form-actions'
actions
.
clearEventListeners
()
@
form
.
data
'form-actions'
,
null
# Clean form listeners
@
clearEventListeners
()
@
form
.
data
'gl-form'
,
null
setupForm
:
->
isNewForm
=
@
form
.
is
(
':not(.gfm-form)'
)
@
form
.
removeClass
"js-new-note-form"
@
form
.
removeClass
'js-new-note-form'
if
isNewForm
@
form
.
find
(
'.div-dropzone'
).
remove
()
@
form
.
addClass
(
'gfm-form'
)
disableButtonIfEmptyField
@
form
.
find
(
".js-note-text"
),
@
form
.
find
(
".js-comment-button"
)
disableButtonIfEmptyField
@
form
.
find
(
'.js-note-text'
),
@
form
.
find
(
'.js-comment-button'
)
# remove notify commit author checkbox for non-commit notes
GitLab
.
GfmAutoComplete
.
setup
()
...
...
@@ -32,6 +44,10 @@ class @GLForm
@
form
.
show
()
clearEventListeners
:
->
@
textarea
.
off
'focus'
@
textarea
.
off
'blur'
addEventListeners
:
->
@
textarea
.
on
'focus'
,
->
$
(
@
).
closest
(
'.md-area'
).
addClass
'is-focused'
...
...
app/assets/javascripts/notes.js.coffee
View file @
5dd01f57
...
...
@@ -513,6 +513,9 @@ class @Notes
removeDiscussionNoteForm
:
(
form
)
->
row
=
form
.
closest
(
"tr"
)
glForm
=
form
.
data
'gl-form'
glForm
.
destroy
()
form
.
find
(
".js-note-text"
).
data
(
"autosave"
).
reset
()
# show the reply button (will only work for replies)
...
...
@@ -524,11 +527,6 @@ class @Notes
# only remove the form
form
.
remove
()
# Remove the note actions
actions
=
form
.
data
(
'form-actions'
)
actions
.
clearEventListeners
()
form
.
data
(
'form-actions'
,
null
)
cancelDiscussionForm
:
(
e
)
=>
e
.
preventDefault
()
form
=
$
(
e
.
target
).
closest
(
".js-discussion-note-form"
)
...
...
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