From 7bc0c8cff66d42c9aa01d2ec107edac60d4a08f3 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 26 Nov 2020 21:31:09 +0100 Subject: [PATCH] Prevent clone protocol button flash on page load (#13626) * Prevent clone protocol button flash on page load Previously, the saved active buttons would flash on page load because if delay involved in JS execution. Prevent these flashes bydisabling transitions on page load and run the script right after. It's not an ideal solution (which would require server-side storage of user settings like this) but I'd say better than before. * add defer Co-authored-by: zeripath --- templates/repo/home.tmpl | 17 +++++++++++++++-- web_src/js/index.js | 24 ++++-------------------- web_src/less/helpers.less | 2 ++ 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 23ee989e32..ee3406fac6 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -111,12 +111,12 @@ {{if eq $n 0}}
{{if not $.DisableHTTP}} - {{end}} {{if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}} - {{end}} @@ -125,6 +125,19 @@ {{else if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}} {{end}} + {{if or (not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH))}}