Commit 0f827531 authored by Phil Hughes's avatar Phil Hughes

Fixed styling of image comment badges on commits

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/54849
parent a89a73c1
...@@ -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);
......
...@@ -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;
......
---
title: Fixed styling of image comment badges on commits
merge_request:
author:
type: fixed
...@@ -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);
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment