Commit 56186063 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'commit-badge-style-fix' into 'master'

Fixed styling of image comment badges on commits

Closes #54849

See merge request gitlab-org/gitlab-ce!23659
parents f124328b 0f827531
......@@ -12,7 +12,7 @@ export function createImageBadge(noteId, { x, y }, classNames = []) {
}
export function addImageBadge(containerEl, { coordinate, badgeText, noteId }) {
const buttonEl = createImageBadge(noteId, coordinate, ['badge']);
const buttonEl = createImageBadge(noteId, coordinate, ['badge', 'badge-pill']);
buttonEl.innerText = badgeText;
containerEl.appendChild(buttonEl);
......
......@@ -914,6 +914,7 @@
padding: 0;
width: (2px * $image-comment-cursor-left-offset);
height: (2px * $image-comment-cursor-top-offset);
color: $blue-400;
// center the indicator to match the top left click region
margin-top: (-1px * $image-comment-cursor-top-offset) + 2;
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', () => {
expect(buttonEl).toBeDefined();
});
it('should add badge classes', () => {
expect(buttonEl.className).toContain('badge badge-pill');
});
it('should set the badge text', () => {
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