From 9d6488343741208241987effe72d79d722d6c8d6 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 9 Feb 2021 17:26:52 +0100 Subject: [PATCH] Fix comment button stuck behind the comments --- www/pad/comments.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/www/pad/comments.js b/www/pad/comments.js index 90ba02471..72935a92b 100644 --- a/www/pad/comments.js +++ b/www/pad/comments.js @@ -761,13 +761,14 @@ define([ title: Messages.comments_comment }, h('i.fa.fa-commenting')); Env.bubble = { - range: ranges[0], + range: ranges[ranges.length-1], button: button }; $(button).click(function(e)  { e.stopPropagation(); Env.editor.execCommand('comment'); Env.bubble = undefined; + removeCommentBubble(Env); }); Env.$contentContainer.find('iframe').before(h('div.cp-comment-bubble', button)); updateBubble(Env); @@ -803,7 +804,7 @@ define([ $(form).remove(); Env.$inner.focus(); - if (!val) { return; } + if (!val) { addCommentBubble(Env); return; } var applicable = Env.editor.plugins.comments.isApplicable(); if (!applicable || !isEditable(Env.ifrWindow.document)) { // text has been deleted by another user while we were typing our comment?