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
99918be7
Commit
99918be7
authored
Apr 07, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added variable button fix
parent
18e2388d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
20 deletions
+38
-20
app/assets/javascripts/comment_type_toggle.js
app/assets/javascripts/comment_type_toggle.js
+21
-17
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+1
-1
spec/javascripts/comment_type_toggle_spec.js
spec/javascripts/comment_type_toggle_spec.js
+16
-2
No files found.
app/assets/javascripts/comment_type_toggle.js
View file @
99918be7
...
...
@@ -31,23 +31,27 @@ class CommentTypeToggle {
}],
};
if
(
!
this
.
closeButton
||
!
this
.
reopenButton
)
return
config
;
config
.
InputSetter
.
push
({
input
:
this
.
closeButton
,
valueAttribute
:
'
data-close-text
'
,
},
{
input
:
this
.
closeButton
,
valueAttribute
:
'
data-close-text
'
,
inputAttribute
:
'
data-alternative-text
'
,
},
{
input
:
this
.
reopenButton
,
valueAttribute
:
'
data-reopen-text
'
,
},
{
input
:
this
.
reopenButton
,
valueAttribute
:
'
data-reopen-text
'
,
inputAttribute
:
'
data-alternative-text
'
,
});
if
(
this
.
closeButton
)
{
config
.
InputSetter
.
push
({
input
:
this
.
closeButton
,
valueAttribute
:
'
data-close-text
'
,
},
{
input
:
this
.
closeButton
,
valueAttribute
:
'
data-close-text
'
,
inputAttribute
:
'
data-alternative-text
'
,
});
}
if
(
this
.
reopenButton
)
{
config
.
InputSetter
.
push
({
input
:
this
.
reopenButton
,
valueAttribute
:
'
data-reopen-text
'
,
},
{
input
:
this
.
reopenButton
,
valueAttribute
:
'
data-reopen-text
'
,
inputAttribute
:
'
data-alternative-text
'
,
});
}
return
config
;
}
...
...
app/assets/javascripts/notes.js
View file @
99918be7
...
...
@@ -143,7 +143,7 @@ require('./task_list');
const
noteTypeInput
=
form
.
querySelector
(
'
#note_type
'
);
const
submitButton
=
form
.
querySelector
(
'
.js-comment-type-dropdown .js-comment-submit-button
'
);
const
closeButton
=
form
.
querySelector
(
'
.js-note-target-close
'
);
const
reopenButton
=
form
.
querySelector
(
'
.js-note-target-reopen
'
);
const
reopenButton
=
form
.
querySelector
(
'
.
reopen-mr-link
'
)
||
form
.
querySelector
(
'
.
js-note-target-reopen
'
);
const
commentTypeToggle
=
new
CommentTypeToggle
({
dropdownTrigger
,
...
...
spec/javascripts/comment_type_toggle_spec.js
View file @
99918be7
...
...
@@ -101,7 +101,7 @@ describe('CommentTypeToggle', function () {
this
.
setConfig
=
CommentTypeToggle
.
prototype
.
setConfig
.
call
(
this
.
commentTypeToggle
);
});
it
(
'
should not add .closeButton
or .reopenButton
related InputSetter config
'
,
function
()
{
it
(
'
should not add .closeButton related InputSetter config
'
,
function
()
{
expect
(
this
.
setConfig
).
toEqual
({
InputSetter
:
[{
input
:
this
.
commentTypeToggle
.
noteTypeInput
,
...
...
@@ -109,6 +109,13 @@ describe('CommentTypeToggle', function () {
},
{
input
:
this
.
commentTypeToggle
.
submitButton
,
valueAttribute
:
'
data-submit-text
'
,
},
{
input
:
this
.
commentTypeToggle
.
reopenButton
,
valueAttribute
:
'
data-reopen-text
'
,
},
{
input
:
this
.
commentTypeToggle
.
reopenButton
,
valueAttribute
:
'
data-reopen-text
'
,
inputAttribute
:
'
data-alternative-text
'
,
}],
});
});
...
...
@@ -127,7 +134,7 @@ describe('CommentTypeToggle', function () {
this
.
setConfig
=
CommentTypeToggle
.
prototype
.
setConfig
.
call
(
this
.
commentTypeToggle
);
});
it
(
'
should not add .
closeButton or .
reopenButton related InputSetter config
'
,
function
()
{
it
(
'
should not add .reopenButton related InputSetter config
'
,
function
()
{
expect
(
this
.
setConfig
).
toEqual
({
InputSetter
:
[{
input
:
this
.
commentTypeToggle
.
noteTypeInput
,
...
...
@@ -135,6 +142,13 @@ describe('CommentTypeToggle', function () {
},
{
input
:
this
.
commentTypeToggle
.
submitButton
,
valueAttribute
:
'
data-submit-text
'
,
},
{
input
:
this
.
commentTypeToggle
.
closeButton
,
valueAttribute
:
'
data-close-text
'
,
},
{
input
:
this
.
commentTypeToggle
.
closeButton
,
valueAttribute
:
'
data-close-text
'
,
inputAttribute
:
'
data-alternative-text
'
,
}],
});
});
...
...
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