summaryrefslogtreecommitdiffstats
path: root/templates/repo
diff options
context:
space:
mode:
authorManuel Kuhlmann <mkuhlmann@users.noreply.github.com>2017-01-05 02:07:43 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2017-01-05 09:07:43 +0800
commita5e07da8bedf5da47a4fec3dda6eaf2e54d69921 (patch)
treef833e5b61a3c19d820410f71840336b316090c75 /templates/repo
parentc5f0d4b1a0255a87a3f29f88e537701685822f61 (diff)
downloadgitea-a5e07da8bedf5da47a4fec3dda6eaf2e54d69921.tar.gz
gitea-a5e07da8bedf5da47a4fec3dda6eaf2e54d69921.zip
Fix diff split view coloring (#553) (#584)
Signed-off-by: Manuel Kuhlmann <manuel@mkuhlmann.org>
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/diff/box.tmpl9
1 files changed, 6 insertions, 3 deletions
diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl
index 8ee4a001ce..9445e7846c 100644
--- a/templates/repo/diff/box.tmpl
+++ b/templates/repo/diff/box.tmpl
@@ -133,16 +133,19 @@
{{if .IsSplitStyle}}
<script>
(function() {
- $('.add-code').each(function() {
+ $('tr.add-code').each(function() {
var prev = $(this).prev();
if(prev.is('.del-code') && prev.children().eq(3).text().trim() === '') {
while(prev.prev().is('.del-code') && prev.prev().children().eq(3).text().trim() === '') {
prev = prev.prev();
}
- prev.children().eq(3).html($(this).children().eq(3).html());
prev.children().eq(2).html($(this).children().eq(2).html());
- prev.children().eq(3).addClass('add-code');
+ prev.children().eq(3).html($(this).children().eq(3).html());
+
+ prev.children().eq(0).addClass('del-code');
+ prev.children().eq(1).addClass('del-code');
prev.children().eq(2).addClass('add-code');
+ prev.children().eq(3).addClass('add-code');
$(this).remove();
}
});