Skip to content

Commit 9dd18f3

Browse files
authored
fix: Allow more then one comment in a line (#337)
1 parent b292f64 commit 9dd18f3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lms/static/grader.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ function visuallyRemoveComment(commentId) {
3939
}
4040
} else {
4141
let removeContent = `<hr>${commentElement.outerHTML}`;
42-
if (!existingPopover.config.content.includes(removeContent)) {
42+
if (!existingPopover._config.content.includes(removeContent)) {
4343
removeContent = `${commentElement.outerHTML} <hr>`;
4444
}
45-
existingPopover.config.content = existingPopover.config.content.replace(removeContent, '');
45+
existingPopover._config.content = existingPopover._config.content.replace(removeContent, '');
4646
const commentParent = commentElement.parentNode;
4747
hr.parentNode.removeChild(hr);
4848
commentParent.removeChild(commentElement);
@@ -118,7 +118,7 @@ function trackDragAreas(lineItems, addCommentItems) {
118118
item.addEventListener('drop', (e) => {
119119
e.preventDefault();
120120
const targets = findElementsToMark(e);
121-
const { line } = targets[0].dataset;
121+
const {line} = targets[0].dataset;
122122
const commentId = e.dataTransfer.getData('text/plain');
123123
window.hoverLine(targets, false);
124124
sendExistsComment(window.fileId, line, commentId);
@@ -136,7 +136,7 @@ function trackDraggables(elements) {
136136

137137
function focusTextArea(lineNumber) {
138138
const target = document.querySelector(`textarea[data-line='${lineNumber}']`);
139-
target.focus({ preventScroll: true });
139+
target.focus({preventScroll: true});
140140
}
141141

142142
function trackTextArea(lineNumber) {
@@ -152,7 +152,7 @@ function trackTextArea(lineNumber) {
152152
}
153153

154154
const popover = bootstrap.Popover.getInstance(popoverElement);
155-
if (popover !== null) { popover.hide(); }
155+
if (popover !== null) {popover.hide();}
156156
});
157157
}
158158

0 commit comments

Comments
 (0)