Show html formatted comments in modal
This commit is contained in:
@ -71,7 +71,8 @@ p.comment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
min-height: 300px;
|
width: 100%;
|
||||||
|
max-height: 300px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ also, all settings from the rails model needed for the editor configuration in t
|
|||||||
currentEditor.getSession().setMode($(editor).data('mode'));
|
currentEditor.getSession().setMode($(editor).data('mode'));
|
||||||
currentEditor.getSession().setOption("useWorker", false);
|
currentEditor.getSession().setOption("useWorker", false);
|
||||||
|
|
||||||
currentEditor.annotationsByLine = {};
|
currentEditor.commentVisualsByLine = {};
|
||||||
setAnnotations(currentEditor, $(editor).data('file-id'));
|
setAnnotations(currentEditor, $(editor).data('file-id'));
|
||||||
currentEditor.on("guttermousedown", handleSidebarClick);
|
currentEditor.on("guttermousedown", handleSidebarClick);
|
||||||
});
|
});
|
||||||
@ -226,13 +226,13 @@ also, all settings from the rails model needed for the editor configuration in t
|
|||||||
});
|
});
|
||||||
|
|
||||||
jqrequest.done(function(response){
|
jqrequest.done(function(response){
|
||||||
editor.annotationsByLine = clusterComments(response.slice());
|
editor.commentVisualsByLine = {};
|
||||||
for (var line in editor.annotationsByLine) {
|
var clusters = clusterComments(response.slice());
|
||||||
if (editor.annotationsByLine.hasOwnProperty(line)) {
|
$.each(clusters, function (line, cluster) {
|
||||||
var htmlContent = generateCommentHtmlContent(editor.annotationsByLine[line]);
|
var htmlContent = generateCommentHtmlContent(cluster);
|
||||||
|
editor.commentVisualsByLine[line] = htmlContent;
|
||||||
buildPopover(fileid, line, htmlContent);
|
buildPopover(fileid, line, htmlContent);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
|
|
||||||
$.each(response, function(index, comment) {
|
$.each(response, function(index, comment) {
|
||||||
comment.className = 'code-ocean_comment';
|
comment.className = 'code-ocean_comment';
|
||||||
@ -302,10 +302,9 @@ also, all settings from the rails model needed for the editor configuration in t
|
|||||||
var commentModal = $('#comment-modal');
|
var commentModal = $('#comment-modal');
|
||||||
|
|
||||||
if (hasCommentsInRow(editor, row)) {
|
if (hasCommentsInRow(editor, row)) {
|
||||||
var rowComments = getCommentsForRow(editor, row);
|
var htmlContent = editor.commentVisualsByLine[row];
|
||||||
var comments = _.pluck(rowComments, 'text').join('\n');
|
|
||||||
commentModal.find('#otherComments').show();
|
commentModal.find('#otherComments').show();
|
||||||
commentModal.find('#otherCommentsTextfield').text(comments);
|
commentModal.find('#otherComments > .container').html(htmlContent);
|
||||||
} else {
|
} else {
|
||||||
commentModal.find('#otherComments').hide();
|
commentModal.find('#otherComments').hide();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user