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
0f827531
Commit
0f827531
authored
Dec 07, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed styling of image comment badges on commits
Closes
https://gitlab.com/gitlab-org/gitlab-ce/issues/54849
parent
a89a73c1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
1 deletion
+11
-1
app/assets/javascripts/image_diff/helpers/badge_helper.js
app/assets/javascripts/image_diff/helpers/badge_helper.js
+1
-1
app/assets/stylesheets/pages/diff.scss
app/assets/stylesheets/pages/diff.scss
+1
-0
changelogs/unreleased/commit-badge-style-fix.yml
changelogs/unreleased/commit-badge-style-fix.yml
+5
-0
spec/javascripts/image_diff/helpers/badge_helper_spec.js
spec/javascripts/image_diff/helpers/badge_helper_spec.js
+4
-0
No files found.
app/assets/javascripts/image_diff/helpers/badge_helper.js
View file @
0f827531
...
@@ -12,7 +12,7 @@ export function createImageBadge(noteId, { x, y }, classNames = []) {
...
@@ -12,7 +12,7 @@ export function createImageBadge(noteId, { x, y }, classNames = []) {
}
}
export
function
addImageBadge
(
containerEl
,
{
coordinate
,
badgeText
,
noteId
})
{
export
function
addImageBadge
(
containerEl
,
{
coordinate
,
badgeText
,
noteId
})
{
const
buttonEl
=
createImageBadge
(
noteId
,
coordinate
,
[
'
badge
'
]);
const
buttonEl
=
createImageBadge
(
noteId
,
coordinate
,
[
'
badge
'
,
'
badge-pill
'
]);
buttonEl
.
innerText
=
badgeText
;
buttonEl
.
innerText
=
badgeText
;
containerEl
.
appendChild
(
buttonEl
);
containerEl
.
appendChild
(
buttonEl
);
...
...
app/assets/stylesheets/pages/diff.scss
View file @
0f827531
...
@@ -914,6 +914,7 @@
...
@@ -914,6 +914,7 @@
padding
:
0
;
padding
:
0
;
width
:
(
2px
*
$image-comment-cursor-left-offset
);
width
:
(
2px
*
$image-comment-cursor-left-offset
);
height
:
(
2px
*
$image-comment-cursor-top-offset
);
height
:
(
2px
*
$image-comment-cursor-top-offset
);
color
:
$blue-400
;
// center the indicator to match the top left click region
// center the indicator to match the top left click region
margin-top
:
(
-1px
*
$image-comment-cursor-top-offset
)
+
2
;
margin-top
:
(
-1px
*
$image-comment-cursor-top-offset
)
+
2
;
margin-left
:
(
-1px
*
$image-comment-cursor-left-offset
)
+
1
;
margin-left
:
(
-1px
*
$image-comment-cursor-left-offset
)
+
1
;
...
...
changelogs/unreleased/commit-badge-style-fix.yml
0 → 100644
View file @
0f827531
---
title
:
Fixed styling of image comment badges on commits
merge_request
:
author
:
type
:
fixed
spec/javascripts/image_diff/helpers/badge_helper_spec.js
View file @
0f827531
...
@@ -61,6 +61,10 @@ describe('badge helper', () => {
...
@@ -61,6 +61,10 @@ describe('badge helper', () => {
expect
(
buttonEl
).
toBeDefined
();
expect
(
buttonEl
).
toBeDefined
();
});
});
it
(
'
should add badge classes
'
,
()
=>
{
expect
(
buttonEl
.
className
).
toContain
(
'
badge badge-pill
'
);
});
it
(
'
should set the badge text
'
,
()
=>
{
it
(
'
should set the badge text
'
,
()
=>
{
expect
(
buttonEl
.
innerText
).
toEqual
(
badgeText
);
expect
(
buttonEl
.
innerText
).
toEqual
(
badgeText
);
});
});
...
...
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