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
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
Show 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,8 +31,7 @@ class CommentTypeToggle {
...
@@ -31,8 +31,7 @@ class CommentTypeToggle {
}],
}],
};
};
if
(
!
this
.
closeButton
||
!
this
.
reopenButton
)
return
config
;
if
(
this
.
closeButton
)
{
config
.
InputSetter
.
push
({
config
.
InputSetter
.
push
({
input
:
this
.
closeButton
,
input
:
this
.
closeButton
,
valueAttribute
:
'
data-close-text
'
,
valueAttribute
:
'
data-close-text
'
,
...
@@ -40,7 +39,11 @@ class CommentTypeToggle {
...
@@ -40,7 +39,11 @@ class CommentTypeToggle {
input
:
this
.
closeButton
,
input
:
this
.
closeButton
,
valueAttribute
:
'
data-close-text
'
,
valueAttribute
:
'
data-close-text
'
,
inputAttribute
:
'
data-alternative-text
'
,
inputAttribute
:
'
data-alternative-text
'
,
},
{
});
}
if
(
this
.
reopenButton
)
{
config
.
InputSetter
.
push
({
input
:
this
.
reopenButton
,
input
:
this
.
reopenButton
,
valueAttribute
:
'
data-reopen-text
'
,
valueAttribute
:
'
data-reopen-text
'
,
},
{
},
{
...
@@ -48,6 +51,7 @@ class CommentTypeToggle {
...
@@ -48,6 +51,7 @@ class CommentTypeToggle {
valueAttribute
:
'
data-reopen-text
'
,
valueAttribute
:
'
data-reopen-text
'
,
inputAttribute
:
'
data-alternative-text
'
,
inputAttribute
:
'
data-alternative-text
'
,
});
});
}
return
config
;
return
config
;
}
}
...
...
app/assets/javascripts/notes.js
View file @
99918be7
...
@@ -143,7 +143,7 @@ require('./task_list');
...
@@ -143,7 +143,7 @@ require('./task_list');
const
noteTypeInput
=
form
.
querySelector
(
'
#note_type
'
);
const
noteTypeInput
=
form
.
querySelector
(
'
#note_type
'
);
const
submitButton
=
form
.
querySelector
(
'
.js-comment-type-dropdown .js-comment-submit-button
'
);
const
submitButton
=
form
.
querySelector
(
'
.js-comment-type-dropdown .js-comment-submit-button
'
);
const
closeButton
=
form
.
querySelector
(
'
.js-note-target-close
'
);
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
({
const
commentTypeToggle
=
new
CommentTypeToggle
({
dropdownTrigger
,
dropdownTrigger
,
...
...
spec/javascripts/comment_type_toggle_spec.js
View file @
99918be7
...
@@ -101,7 +101,7 @@ describe('CommentTypeToggle', function () {
...
@@ -101,7 +101,7 @@ describe('CommentTypeToggle', function () {
this
.
setConfig
=
CommentTypeToggle
.
prototype
.
setConfig
.
call
(
this
.
commentTypeToggle
);
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
({
expect
(
this
.
setConfig
).
toEqual
({
InputSetter
:
[{
InputSetter
:
[{
input
:
this
.
commentTypeToggle
.
noteTypeInput
,
input
:
this
.
commentTypeToggle
.
noteTypeInput
,
...
@@ -109,6 +109,13 @@ describe('CommentTypeToggle', function () {
...
@@ -109,6 +109,13 @@ describe('CommentTypeToggle', function () {
},
{
},
{
input
:
this
.
commentTypeToggle
.
submitButton
,
input
:
this
.
commentTypeToggle
.
submitButton
,
valueAttribute
:
'
data-submit-text
'
,
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 () {
...
@@ -127,7 +134,7 @@ describe('CommentTypeToggle', function () {
this
.
setConfig
=
CommentTypeToggle
.
prototype
.
setConfig
.
call
(
this
.
commentTypeToggle
);
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
({
expect
(
this
.
setConfig
).
toEqual
({
InputSetter
:
[{
InputSetter
:
[{
input
:
this
.
commentTypeToggle
.
noteTypeInput
,
input
:
this
.
commentTypeToggle
.
noteTypeInput
,
...
@@ -135,6 +142,13 @@ describe('CommentTypeToggle', function () {
...
@@ -135,6 +142,13 @@ describe('CommentTypeToggle', function () {
},
{
},
{
input
:
this
.
commentTypeToggle
.
submitButton
,
input
:
this
.
commentTypeToggle
.
submitButton
,
valueAttribute
:
'
data-submit-text
'
,
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