summaryrefslogtreecommitdiffstats
path: root/templates/repo/wiki/view.tmpl
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2022-07-31 20:29:55 +0200
committerGitHub <noreply@github.com>2022-07-31 20:29:55 +0200
commit335e918b1129ef6e0dd03a4713de90e68fbb23e3 (patch)
tree82afb38535535754d3b307bddf04ff8dc5feed85 /templates/repo/wiki/view.tmpl
parent589677fafb4b77112b7220a1c6089cec71d6db94 (diff)
downloadgitea-335e918b1129ef6e0dd03a4713de90e68fbb23e3.tar.gz
gitea-335e918b1129ef6e0dd03a4713de90e68fbb23e3.zip
Clean up and fix clone button script (#20415)
The button 'primary' class needs to be set in a synchronous script to prevent flicker of the button which was regressed recently, fixed that. Additionally, reduced the two script tags to just one, the previous scripts were actually initializing the buttons thrice on the empty repo page, now it only initializes once. Finally, removed duplicate code and re-used the inline function in the update code as well. I had to split out the script into a separate template as on the empty repo page, the script needs access to the clone URL span in the example text, which is rendered below the clone buttons, so buttons and script could not be combined.
Diffstat (limited to 'templates/repo/wiki/view.tmpl')
-rw-r--r--templates/repo/wiki/view.tmpl1
1 files changed, 1 insertions, 0 deletions
diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl
index 91a15f19e2..21affddc62 100644
--- a/templates/repo/wiki/view.tmpl
+++ b/templates/repo/wiki/view.tmpl
@@ -31,6 +31,7 @@
<div class="right fitted item">
<div class="ui action small input" id="clone-panel">
{{template "repo/clone_buttons" .}}
+ {{template "repo/clone_script" .}}
</div>
</div>
</div>