Skip to content

Commit

Permalink
Fix Split-View line adjustment (#4622)
Browse files Browse the repository at this point in the history
The $-function is unreachable in the previous implementation because jQuery is
not loaded yet. I fix this by executing the function after the content is
loaded, so jQuery is loaded at the time of execution and the call will not fail
anymore.

Signed-off-by: Felix Nehrke <felix@nehrke.info>
  • Loading branch information
nemoinho authored and lunny committed Aug 9, 2018
1 parent 578cf52 commit 0e04a20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/repo/diff/box.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@

{{if .IsSplitStyle}}
<script>
(function() {
document.addEventListener('DOMContentLoaded', function() {
$('tr.add-code').each(function() {
var prev = $(this).prev();
if(prev.is('.del-code') && prev.children().eq(3).text().trim() === '') {
Expand All @@ -217,7 +217,7 @@
$(this).remove();
}
});
}());
});
</script>
{{end}}
{{end}}

0 comments on commit 0e04a20

Please sign in to comment.