diff options
author | silverwind <me@silverwind.io> | 2022-07-31 20:29:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-31 20:29:55 +0200 |
commit | 335e918b1129ef6e0dd03a4713de90e68fbb23e3 (patch) | |
tree | 82afb38535535754d3b307bddf04ff8dc5feed85 /templates/repo/wiki | |
parent | 589677fafb4b77112b7220a1c6089cec71d6db94 (diff) | |
download | gitea-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')
-rw-r--r-- | templates/repo/wiki/revision.tmpl | 1 | ||||
-rw-r--r-- | templates/repo/wiki/view.tmpl | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/templates/repo/wiki/revision.tmpl b/templates/repo/wiki/revision.tmpl index 577eb6e6c0..71b69220c6 100644 --- a/templates/repo/wiki/revision.tmpl +++ b/templates/repo/wiki/revision.tmpl @@ -7,6 +7,7 @@ <div class="ui eight wide column text right df ac je"> <div class="ui action small input" id="clone-panel"> {{template "repo/clone_buttons" .}} + {{template "repo/clone_script" .}} </div> </div> <div class="ui header eight wide column"> 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> |