Skip to content

Commit b292f64

Browse files
authored
fix: Allow more then one comment in a line (#336)
1 parent 7762f60 commit b292f64

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lms/static/comments.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ const FLAKE_COMMENTED_LINE_COLOR = '#fac4c3';
44
const HOVER_LINE_STYLE = '1px solid #0d0d0f';
55

66
function markLine(target, color, deletion = false) {
7-
if (target.dataset && target.dataset.marked === 'true' && !deletion) { return; }
8-
if (target.dataset && target.dataset.vimbackground === 'true' && !deletion) { return; }
7+
if (target.dataset && target.dataset.marked === 'true' && !deletion) {return;}
8+
if (target.dataset && target.dataset.vimbackground === 'true' && !deletion) {return;}
99
target.style.background = color;
1010
}
1111

1212
function hoverLine(targets, hover) {
1313
const [lineTarget, addCommentTarget] = targets;
14-
if (lineTarget.dataset && lineTarget.dataset.vimbackground === 'true') { return; }
14+
if (lineTarget.dataset && lineTarget.dataset.vimbackground === 'true') {return;}
1515
const commentOpacity = (hover === true) ? '1' : '0';
1616
let parsedColor = hover;
1717
if (hover === true) {
@@ -44,8 +44,8 @@ function addCommentToLine(line, commentData) {
4444
const commentText = `<span class="comment" data-line="${line}" data-commentid="${commentData.id}" data-author-role="${commentData.author_role}">${formattedComment}</span>`;
4545
let existingPopover = bootstrap.Popover.getInstance(commentElement);
4646
if (existingPopover !== null) {
47-
const existingContent = `${existingPopover.config.content} <hr>`;
48-
existingPopover.config.content = existingContent + commentText;
47+
const existingContent = `${existingPopover._config.content} <hr>`;
48+
existingPopover._config.content = existingContent + commentText;
4949
} else {
5050
existingPopover = new bootstrap.Popover(commentElement, {
5151
html: true,

0 commit comments

Comments
 (0)