diff --git a/kallithea/lib/diffs.py b/kallithea/lib/diffs.py --- a/kallithea/lib/diffs.py +++ b/kallithea/lib/diffs.py @@ -720,7 +720,7 @@ class DiffProcessor(object): 'cc': code_class, 'inc': comments }) - _html.append('''\n\t\t
%(code)s
\n''' % { + _html.append('''\n\t\t
 
%(code)s
\n''' % { 'code': change['line'] }) 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 @@ -4915,6 +4915,7 @@ div.diffblock { } div.diffblock.margined { margin: 0px 20px 0px 20px; + overflow: hidden; } div.diffblock .code-header { border-bottom: 1px solid #CCCCCC; @@ -5085,19 +5086,27 @@ table.code-difftable .code pre { line-height: 17px; } - -.diffblock.margined.comm .line .code:hover { - background-color: #FFFFCC !important; - cursor: pointer !important; - background-image: url("../images/icons/comment_add.png") !important; - background-repeat: no-repeat !important; - background-position: right !important; - background-position: 0% 50% !important; -} -.diffblock.margined.comm .line .code.no-comment:hover { - background-image: none !important; - cursor: auto !important; - background-color: inherit !important; +.add-bubble { + display: none; + float: left; + width: 0px; + height: 0px; +} + +tr.line.add td.code:hover .add-bubble, +tr.line.del td.code:hover .add-bubble, +tr.line.unmod td.code:hover .add-bubble { + display: inherit; +} + +.add-bubble div { + position: relative; + left: -32px; + width: 32px; + top: -8px; + height: 32px; + background: url("../images/icons/comment_add.png") no-repeat 100% 50%; + cursor: pointer; } div.comment:target>.comment-wrapp { 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 @@ -197,12 +197,12 @@ ${self.repo_context_bar('changelog', c.c } }) - YUE.on(YUQ('.line'),'click',function(e){ + YUE.on(YUQ('.add-bubble'),'click',function(e){ var tr = e.currentTarget; if(tr == null){ tr = this; } - injectInlineForm(tr); + injectInlineForm(tr.parentNode.parentNode); }); // inject comments into they proper positions 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 @@ -350,9 +350,9 @@ ${self.repo_context_bar('showpullrequest } }) - YUE.on(YUQ('.line'),'click',function(e){ + YUE.on(YUQ('.add-bubble'),'click',function(e){ var tr = e.currentTarget; - injectInlineForm(tr); + injectInlineForm(tr.parentNode.parentNode); }); // inject comments into they proper positions