[PATCH v2] comments: remove dysfunctional comment bubble on compare and file views (issue #84)

Thomas De Schampheleire patrickdepinguin at gmail.com
Thu Jun 18 02:57:39 EDT 2015


# HG changeset patch
# User Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
# Date 1434609967 -7200
#      Thu Jun 18 08:46:07 2015 +0200
# Node ID 8edae8d388db2ba77e68abc95f4db954b396e9cc
# Parent  5fb4e6f884cec710b34736756d4eadaa53dd51d0
comments: remove dysfunctional comment bubble on compare and file views (issue #84)

Several compare and file views would show a comment bubble when hovering
code lines, even though clicking on this bubble would not do anything.

Instead, make sure that the bubble only appears when the diff block is in a
class 'commentable-diff', which can be set from the appropriate places
(changeset and pullrequest views) where a click handler is also attached.

diff --git a/kallithea/public/css/style.css b/kallithea/public/css/style.css
--- a/kallithea/public/css/style.css
+++ b/kallithea/public/css/style.css
@@ -5008,9 +5008,10 @@ table.code-difftable .unmod .code pre:be
     box-sizing: border-box;
 }
 
-tr.line.add:hover td .add-bubble,
-tr.line.del:hover td .add-bubble,
-tr.line.unmod:hover td .add-bubble {
+/* comment bubble, only visible when in a commentable diff */
+.commentable-diff tr.line.add:hover td .add-bubble,
+.commentable-diff tr.line.del:hover td .add-bubble,
+.commentable-diff tr.line.unmod:hover td .add-bubble {
     display: block;
     z-index: 1;
 }
diff --git a/kallithea/templates/changeset/changeset.html b/kallithea/templates/changeset/changeset.html
--- a/kallithea/templates/changeset/changeset.html
+++ b/kallithea/templates/changeset/changeset.html
@@ -158,13 +158,14 @@
     </div>
 
     ## diff block
+    <div class="commentable-diff">
     <%namespace name="diff_block" file="/changeset/diff_block.html"/>
     ${diff_block.diff_block_js()}
     ${diff_block.diff_block(c.changes[c.changeset.raw_id])}
-
     % if c.limited_diff:
       <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff anyway')}</a></h4>
     % endif
+    </div>
 
     ## template for inline comment form
     ${comment.comment_inline_form()}
diff --git a/kallithea/templates/pullrequests/pullrequest_show.html b/kallithea/templates/pullrequests/pullrequest_show.html
--- a/kallithea/templates/pullrequests/pullrequest_show.html
+++ b/kallithea/templates/pullrequests/pullrequest_show.html
@@ -341,6 +341,7 @@
     </script>
 
     ## diff block
+    <div class="commentable-diff">
     <%namespace name="diff_block" file="/changeset/diff_block.html"/>
     ${diff_block.diff_block_js()}
     %for fid, change, f, stat in c.files:
@@ -349,6 +350,7 @@
     % if c.limited_diff:
       <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff anyway')}</a></h4>
     % endif
+    </div>
 
 
     ## template for inline comment form


More information about the kallithea-general mailing list