changeset 5189:329c0584cba8

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.
author Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
date Thu, 18 Jun 2015 08:46:07 +0200
parents 6db5d95c2d21
children c082a017b366
files kallithea/public/css/style.css kallithea/templates/changeset/changeset.html kallithea/templates/pullrequests/pullrequest_show.html
diffstat 3 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/public/css/style.css	Wed Jun 17 13:24:00 2015 +0200
+++ b/kallithea/public/css/style.css	Thu Jun 18 08:46:07 2015 +0200
@@ -5008,9 +5008,10 @@
     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;
 }
--- a/kallithea/templates/changeset/changeset.html	Wed Jun 17 13:24:00 2015 +0200
+++ b/kallithea/templates/changeset/changeset.html	Thu Jun 18 08:46:07 2015 +0200
@@ -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()}
--- a/kallithea/templates/pullrequests/pullrequest_show.html	Wed Jun 17 13:24:00 2015 +0200
+++ b/kallithea/templates/pullrequests/pullrequest_show.html	Thu Jun 18 08:46:07 2015 +0200
@@ -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,7 +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
     ${comment.comment_inline_form()}