Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Load the scripts with defer
A plain script in the head held up parsing until it had downloaded and
run, though cgit.js only acts once the document is ready. Deferred
scripts still run in the order given and before DOMContentLoaded, so a
site script after cgit.js can still call window.cgit.
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0005-markup.sh | 5 |
1 file changed, 5 insertions, 0 deletions
diff --git a/tests/t0005-markup.sh b/tests/t0005-markup.sh index e2bf8f3..22ac81c 100755 --- a/tests/t0005-markup.sh +++ b/tests/t0005-markup.sh @@ -120,6 +120,11 @@ test_expect_success 'the page background is the same everywhere it is set' ' test_cmp expect actual ' +test_expect_success 'the script waits for the page instead of holding it up' ' + hooks "hooks/" >tmp && + grep "<script src=./cgit.js. defer></script>" tmp +' + # The rest of the hooks need a tag, a symlink, a submodule, a trailer, a lone # carriage return, clone urls, an empty repository and a second page of # repositories, so they get a commit and a config of their own after the checks |
