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
00855926
Commit
00855926
authored
Apr 05, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move CommentTypeToggle use from gl_form to notes
parent
5e3fa025
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
17 deletions
+16
-17
app/assets/javascripts/gl_form.js
app/assets/javascripts/gl_form.js
+0
-16
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+16
-1
No files found.
app/assets/javascripts/gl_form.js
View file @
00855926
...
...
@@ -3,8 +3,6 @@
/* global DropzoneInput */
/* global autosize */
import
CommentTypeToggle
from
'
./comment_type_toggle
'
;
window
.
gl
=
window
.
gl
||
{};
function
GLForm
(
form
)
{
...
...
@@ -43,20 +41,6 @@ GLForm.prototype.setupForm = function() {
this
.
form
.
find
(
'
.js-note-discard
'
).
hide
();
this
.
form
.
show
();
if
(
this
.
isAutosizeable
)
this
.
setupAutosize
();
this
.
initCommentTypeToggle
();
};
GLForm
.
prototype
.
initCommentTypeToggle
=
function
()
{
this
.
commentTypeToggle
=
new
CommentTypeToggle
(
this
.
form
[
0
].
querySelector
(
'
.js-comment-type-dropdown .dropdown-toggle
'
),
this
.
form
[
0
].
querySelector
(
'
.js-comment-type-dropdown .dropdown-menu
'
),
document
.
getElementById
(
'
note_type
'
),
this
.
form
[
0
].
querySelector
(
'
.js-comment-type-dropdown .js-comment-submit-button
'
),
document
.
querySelector
(
'
.js-note-target-close
'
),
);
this
.
commentTypeToggle
.
initDroplab
();
};
GLForm
.
prototype
.
setupAutosize
=
function
()
{
...
...
app/assets/javascripts/notes.js
View file @
00855926
...
...
@@ -5,6 +5,7 @@
/* global mrRefreshWidgetUrl */
import
Cookies
from
'
js-cookie
'
;
import
CommentTypeToggle
from
'
./comment_type_toggle
'
;
require
(
'
./autosave
'
);
window
.
autosize
=
require
(
'
vendor/autosize
'
);
...
...
@@ -137,6 +138,18 @@ require('./task_list');
$
(
document
).
off
(
"
click
"
,
'
.system-note-commit-list-toggler
'
);
};
Notes
.
prototype
.
initCommentTypeToggle
=
function
(
form
)
{
this
.
commentTypeToggle
=
new
CommentTypeToggle
(
form
[
0
].
querySelector
(
'
.js-comment-type-dropdown .dropdown-toggle
'
),
form
[
0
].
querySelector
(
'
.js-comment-type-dropdown .dropdown-menu
'
),
document
.
getElementById
(
'
note_type
'
),
form
[
0
].
querySelector
(
'
.js-comment-type-dropdown .js-comment-submit-button
'
),
document
.
querySelector
(
'
.js-note-target-close
'
),
);
this
.
commentTypeToggle
.
initDroplab
();
};
Notes
.
prototype
.
keydownNoteText
=
function
(
e
)
{
var
$textarea
,
discussionNoteForm
,
editNote
,
myLastNote
,
myLastNoteEditBtn
,
newText
,
originalText
;
if
(
gl
.
utils
.
isMetaKey
(
e
))
{
...
...
@@ -455,7 +468,9 @@ require('./task_list');
form
.
find
(
"
#note_type
"
).
val
(
''
);
form
.
find
(
"
#in_reply_to_discussion_id
"
).
remove
();
form
.
find
(
'
.js-comment-resolve-button
'
).
closest
(
'
comment-and-resolve-btn
'
).
remove
();
return
this
.
parentTimeline
=
form
.
parents
(
'
.timeline
'
);
this
.
parentTimeline
=
form
.
parents
(
'
.timeline
'
);
this
.
initCommentTypeToggle
(
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