1
0
Fork 0
forked from forgejo/forgejo

Fix diff split view coloring (#553) (#584)

Signed-off-by: Manuel Kuhlmann <manuel@mkuhlmann.org>
This commit is contained in:
Manuel Kuhlmann 2017-01-05 02:07:43 +01:00 committed by Lunny Xiao
parent c5f0d4b1a0
commit a5e07da8be
3 changed files with 50 additions and 47 deletions

View file

@ -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();
}
});