diff options
author | nemoinho <felix@nehrke.info> | 2018-08-09 10:28:55 +0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2018-08-09 16:28:55 +0800 |
commit | 0e04a2091a4391c245042df54f240b8c3d6131cc (patch) | |
tree | c8368491f0ab9221f96ce4b5f409b30456a66b76 /templates | |
parent | 578cf52ce5baf166dc5e4eeaca7814b3253bab5e (diff) | |
download | gitea-0e04a2091a4391c245042df54f240b8c3d6131cc.tar.gz gitea-0e04a2091a4391c245042df54f240b8c3d6131cc.zip |
Fix Split-View line adjustment (#4622)
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>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/diff/box.tmpl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 572ed17e15..0a9552acc1 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -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() === '') { @@ -217,7 +217,7 @@ $(this).remove(); } }); - }()); + }); </script> {{end}} {{end}} |