Fix comment button stuck behind the comments

pull/1/head
yflory 4 years ago
parent 77f12a95cf
commit 9d64883437

@ -761,13 +761,14 @@ define([
title: Messages.comments_comment title: Messages.comments_comment
}, h('i.fa.fa-commenting')); }, h('i.fa.fa-commenting'));
Env.bubble = { Env.bubble = {
range: ranges[0], range: ranges[ranges.length-1],
button: button button: button
}; };
$(button).click(function(e)  { $(button).click(function(e)  {
e.stopPropagation(); e.stopPropagation();
Env.editor.execCommand('comment'); Env.editor.execCommand('comment');
Env.bubble = undefined; Env.bubble = undefined;
removeCommentBubble(Env);
}); });
Env.$contentContainer.find('iframe').before(h('div.cp-comment-bubble', button)); Env.$contentContainer.find('iframe').before(h('div.cp-comment-bubble', button));
updateBubble(Env); updateBubble(Env);
@ -803,7 +804,7 @@ define([
$(form).remove(); $(form).remove();
Env.$inner.focus(); Env.$inner.focus();
if (!val) { return; } if (!val) { addCommentBubble(Env); return; }
var applicable = Env.editor.plugins.comments.isApplicable(); var applicable = Env.editor.plugins.comments.isApplicable();
if (!applicable || !isEditable(Env.ifrWindow.document)) { if (!applicable || !isEditable(Env.ifrWindow.document)) {
// text has been deleted by another user while we were typing our comment? // text has been deleted by another user while we were typing our comment?

Loading…
Cancel
Save