BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
5200686b
Commit
5200686b
authored
Apr 06, 2017
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable submit button and dropdown when submitt comment form
parent
d9dedac8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
notes.js
app/assets/javascripts/notes.js
+7
-0
_comment_type_button.html.haml
app/views/projects/notes/_comment_type_button.html.haml
+1
-2
No files found.
app/assets/javascripts/notes.js
View file @
5200686b
...
...
@@ -112,10 +112,17 @@ require('./task_list');
// when issue status changes, we need to refresh data
$
(
document
).
on
(
"issuable:change"
,
this
.
refresh
);
$
(
document
).
on
(
'submit'
,
'.js-main-target-form'
,
this
.
disableDropdown
)
// when a key is clicked on the notes
return
$
(
document
).
on
(
"keydown"
,
".js-note-text"
,
this
.
keydownNoteText
);
};
Notes
.
prototype
.
disableDropdown
=
function
(
e
)
{
const
$form
=
$
(
e
.
target
);
$form
.
find
(
'.js-note-new-discussion'
).
disable
();
};
Notes
.
prototype
.
cleanBinding
=
function
()
{
$
(
document
).
off
(
"ajax:success"
,
".js-main-target-form"
);
$
(
document
).
off
(
"ajax:success"
,
".js-discussion-note-form"
);
...
...
app/views/projects/notes/_comment_type_button.html.haml
View file @
5200686b
-
noteable_type
=
@note
.
noteable_type
.pull-left.btn-group.append-right-10.comment-type-dropdown.js-comment-type-dropdown
%button
.btn.btn-nr.btn-create.comment-btn.js-comment-button.js-comment-submit-button
Comment
%input
.btn.btn-nr.btn-create.comment-btn.js-comment-button.js-comment-submit-button
{
type:
'submit'
,
value:
'Comment'
}
-
if
@note
.
can_be_discussion_note?
=
button_tag
type:
'button'
,
class:
'btn btn-nr dropdown-toggle comment-btn js-note-new-discussion'
,
data:
{
'dropdown-trigger'
=>
'#resolvable-comment-menu'
}
do
=
icon
(
'caret-down'
)
...
...
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