Add support for readonly and disconnected modes in comments

pull/1/head
yflory 5 years ago
parent 43fc0a3721
commit 5b337bef7d

@ -9,6 +9,19 @@
overflow-y: auto;
color: @cryptpad_text_col;
&.cp-comments-readonly {
.cp-comment-actions {
display: none !important;
}
.cp-comment-form {
display: none !important;
}
.cp-comment-edit {
display: none !important;
}
}
.buttons_main();
.cp-comment-reply {

@ -875,6 +875,16 @@ define([
var Env = cfg;
Env.comments = Util.clone(COMMENTS);
var ro = cfg.framework.isReadOnly();
var onEditableChange = function (unlocked) {
Env.$container.removeClass('cp-comments-readonly');
if (ro || !unlocked) {
Env.$container.addClass('cp-comments-readonly');
}
};
cfg.framework.onEditableChange(onEditableChange);
onEditableChange();
addAddCommentHandler(Env);
// Unselect comment when clicking outside

Loading…
Cancel
Save