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
Tatuya Kamada
gitlab-ce
Commits
2a18425e
Commit
2a18425e
authored
Apr 06, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
phil review changes
parent
75ac2699
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
29 deletions
+20
-29
app/assets/javascripts/comment_type_toggle.js
app/assets/javascripts/comment_type_toggle.js
+12
-12
app/assets/javascripts/gl_form.js
app/assets/javascripts/gl_form.js
+1
-4
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+1
-1
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+2
-10
app/assets/stylesheets/pages/note_form.scss
app/assets/stylesheets/pages/note_form.scss
+2
-0
app/views/projects/notes/_comment_type_button.html.haml
app/views/projects/notes/_comment_type_button.html.haml
+2
-2
No files found.
app/assets/javascripts/comment_type_toggle.js
View file @
2a18425e
...
@@ -2,37 +2,37 @@ import DropLab from '@gitlab-org/droplab';
...
@@ -2,37 +2,37 @@ import DropLab from '@gitlab-org/droplab';
import
InputSetter
from
'
@gitlab-org/droplab/dist/plugins/InputSetter
'
;
import
InputSetter
from
'
@gitlab-org/droplab/dist/plugins/InputSetter
'
;
class
CommentTypeToggle
{
class
CommentTypeToggle
{
constructor
(
trigger
,
list
,
input
,
button
,
secondary
Button
)
{
constructor
(
dropdownTrigger
,
dropdownList
,
noteTypeInput
,
submitButton
,
close
Button
)
{
this
.
trigger
=
t
rigger
;
this
.
dropdownTrigger
=
dropdownT
rigger
;
this
.
list
=
l
ist
;
this
.
dropdownList
=
dropdownL
ist
;
this
.
input
=
i
nput
;
this
.
noteTypeInput
=
noteTypeI
nput
;
this
.
button
=
b
utton
;
this
.
submitButton
=
submitB
utton
;
this
.
secondaryButton
=
secondary
Button
;
this
.
closeButton
=
close
Button
;
}
}
initDroplab
()
{
initDroplab
()
{
this
.
droplab
=
new
DropLab
();
this
.
droplab
=
new
DropLab
();
const
inputSetterConfig
=
[{
const
inputSetterConfig
=
[{
input
:
this
.
i
nput
,
input
:
this
.
noteTypeI
nput
,
valueAttribute
:
'
data-value
'
,
valueAttribute
:
'
data-value
'
,
},
},
{
{
input
:
this
.
b
utton
,
input
:
this
.
submitB
utton
,
valueAttribute
:
'
data-button-text
'
,
valueAttribute
:
'
data-button-text
'
,
}];
}];
if
(
this
.
secondary
Button
)
{
if
(
this
.
close
Button
)
{
inputSetterConfig
.
push
({
inputSetterConfig
.
push
({
input
:
this
.
secondary
Button
,
input
:
this
.
close
Button
,
valueAttribute
:
'
data-secondary-button-text
'
,
valueAttribute
:
'
data-secondary-button-text
'
,
},
{
},
{
input
:
this
.
secondary
Button
,
input
:
this
.
close
Button
,
valueAttribute
:
'
data-secondary-button-text
'
,
valueAttribute
:
'
data-secondary-button-text
'
,
inputAttribute
:
'
data-alternative-text
'
,
inputAttribute
:
'
data-alternative-text
'
,
});
});
}
}
this
.
droplab
.
init
(
this
.
trigger
,
this
.
l
ist
,
[
InputSetter
],
{
this
.
droplab
.
init
(
this
.
dropdownTrigger
,
this
.
dropdownL
ist
,
[
InputSetter
],
{
InputSetter
:
inputSetterConfig
InputSetter
:
inputSetterConfig
});
});
}
}
...
...
app/assets/javascripts/gl_form.js
View file @
2a18425e
...
@@ -29,10 +29,7 @@ GLForm.prototype.setupForm = function() {
...
@@ -29,10 +29,7 @@ GLForm.prototype.setupForm = function() {
this
.
form
.
find
(
'
.div-dropzone
'
).
remove
();
this
.
form
.
find
(
'
.div-dropzone
'
).
remove
();
this
.
form
.
addClass
(
'
gfm-form
'
);
this
.
form
.
addClass
(
'
gfm-form
'
);
// remove notify commit author checkbox for non-commit notes
// remove notify commit author checkbox for non-commit notes
gl
.
utils
.
disableButtonIfEmptyField
(
this
.
form
.
find
(
'
.js-note-text
'
),
this
.
form
.
find
(
'
.js-comment-button
'
));
gl
.
utils
.
disableButtonIfEmptyField
(
this
.
form
.
find
(
'
.js-note-text
'
),
this
.
form
.
find
(
'
.js-comment-button, .js-note-new-discussion
'
));
const
newDiscussionToggle
=
this
.
form
.
find
(
'
.js-note-new-discussion
'
);
if
(
newDiscussionToggle
)
gl
.
utils
.
disableButtonIfEmptyField
(
this
.
form
.
find
(
'
.js-note-text
'
),
newDiscussionToggle
);
gl
.
GfmAutoComplete
.
setup
(
this
.
form
.
find
(
'
.js-gfm-input
'
));
gl
.
GfmAutoComplete
.
setup
(
this
.
form
.
find
(
'
.js-gfm-input
'
));
new
DropzoneInput
(
this
.
form
);
new
DropzoneInput
(
this
.
form
);
...
...
app/assets/javascripts/main.js
View file @
2a18425e
...
@@ -279,7 +279,7 @@ $(function () {
...
@@ -279,7 +279,7 @@ $(function () {
// Disable form buttons while a form is submitting
// Disable form buttons while a form is submitting
$body
.
on
(
'
ajax:complete, ajax:beforeSend, submit
'
,
'
form
'
,
function
(
e
)
{
$body
.
on
(
'
ajax:complete, ajax:beforeSend, submit
'
,
'
form
'
,
function
(
e
)
{
var
buttons
;
var
buttons
;
buttons
=
$
(
'
[type="submit"]
'
,
this
);
buttons
=
$
(
'
[type="submit"]
, .js-disable-on-submit
'
,
this
);
switch
(
e
.
type
)
{
switch
(
e
.
type
)
{
case
'
ajax:beforeSend
'
:
case
'
ajax:beforeSend
'
:
case
'
submit
'
:
case
'
submit
'
:
...
...
app/assets/javascripts/notes.js
View file @
2a18425e
...
@@ -111,18 +111,10 @@ require('./task_list');
...
@@ -111,18 +111,10 @@ require('./task_list');
$
(
document
).
on
(
"
visibilitychange
"
,
this
.
visibilityChange
);
$
(
document
).
on
(
"
visibilitychange
"
,
this
.
visibilityChange
);
// when issue status changes, we need to refresh data
// when issue status changes, we need to refresh data
$
(
document
).
on
(
"
issuable:change
"
,
this
.
refresh
);
$
(
document
).
on
(
"
issuable:change
"
,
this
.
refresh
);
$
(
document
).
on
(
'
submit
'
,
'
.js-main-target-form
'
,
this
.
disableDropdown
)
// when a key is clicked on the notes
// when a key is clicked on the notes
return
$
(
document
).
on
(
"
keydown
"
,
"
.js-note-text
"
,
this
.
keydownNoteText
);
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
()
{
Notes
.
prototype
.
cleanBinding
=
function
()
{
$
(
document
).
off
(
"
ajax:success
"
,
"
.js-main-target-form
"
);
$
(
document
).
off
(
"
ajax:success
"
,
"
.js-main-target-form
"
);
$
(
document
).
off
(
"
ajax:success
"
,
"
.js-discussion-note-form
"
);
$
(
document
).
off
(
"
ajax:success
"
,
"
.js-discussion-note-form
"
);
...
@@ -149,9 +141,9 @@ require('./task_list');
...
@@ -149,9 +141,9 @@ require('./task_list');
this
.
commentTypeToggle
=
new
CommentTypeToggle
(
this
.
commentTypeToggle
=
new
CommentTypeToggle
(
form
.
querySelector
(
'
.js-comment-type-dropdown .dropdown-toggle
'
),
form
.
querySelector
(
'
.js-comment-type-dropdown .dropdown-toggle
'
),
form
.
querySelector
(
'
.js-comment-type-dropdown .dropdown-menu
'
),
form
.
querySelector
(
'
.js-comment-type-dropdown .dropdown-menu
'
),
document
.
querySelector
(
'
.js-main-target-form
#note_type
'
),
form
.
querySelector
(
'
#note_type
'
),
form
.
querySelector
(
'
.js-comment-type-dropdown .js-comment-submit-button
'
),
form
.
querySelector
(
'
.js-comment-type-dropdown .js-comment-submit-button
'
),
document
.
querySelector
(
'
.js-main-target-form
.js-note-target-close
'
),
form
.
querySelector
(
'
.js-note-target-close
'
),
);
);
this
.
commentTypeToggle
.
initDroplab
();
this
.
commentTypeToggle
.
initDroplab
();
...
...
app/assets/stylesheets/pages/note_form.scss
View file @
2a18425e
...
@@ -312,6 +312,8 @@
...
@@ -312,6 +312,8 @@
}
}
.comment-type-dropdown
{
.comment-type-dropdown
{
background
:
red
;
.dropdown-toggle
.fa
{
.dropdown-toggle
.fa
{
color
:
$white-light
;
color
:
$white-light
;
padding-right
:
2px
;
padding-right
:
2px
;
...
...
app/views/projects/notes/_comment_type_button.html.haml
View file @
2a18425e
...
@@ -3,10 +3,10 @@
...
@@ -3,10 +3,10 @@
.pull-left.btn-group.append-right-10.comment-type-dropdown.js-comment-type-dropdown
.pull-left.btn-group.append-right-10.comment-type-dropdown.js-comment-type-dropdown
%input
.btn.btn-nr.btn-create.comment-btn.js-comment-button.js-comment-submit-button
{
type:
'submit'
,
value:
'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?
-
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
=
button_tag
type:
'button'
,
class:
'btn btn-nr dropdown-toggle comment-btn js-note-new-discussion
js-disable-on-submit'
,
data:
{
'dropdown-trigger'
=>
'#resolvable-comment-menu'
},
'aria-label'
=>
'Open comment type dropdown'
do
=
icon
(
'caret-down'
)
=
icon
(
'caret-down'
)
%ul
#resolvable-comment-menu
.dropdown-menu
{
data:
{
dropdown:
true
}
}
%ul
#resolvable-comment-menu
.dropdown-menu
{
data:
{
dropdown:
true
}
}
%li
#comment
{
data:
{
value:
''
,
'button-text'
=>
'Comment'
,
'secondary-button-text'
=>
'Comment & close merge request'
},
class:
'droplab-item-selected'
}
%li
#comment
.droplab-item-selected
{
data:
{
value:
''
,
'button-text'
=>
'Comment'
,
'secondary-button-text'
=>
"Comment & close #{noteable_type.titleize.downcase}"
}
}
=
icon
(
'check'
)
=
icon
(
'check'
)
.description
.description
%strong
Comment
%strong
Comment
...
...
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