summaryrefslogtreecommitdiffstats
path: root/templates/repo/clone_buttons.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'templates/repo/clone_buttons.tmpl')
-rw-r--r--templates/repo/clone_buttons.tmpl11
1 files changed, 1 insertions, 10 deletions
diff --git a/templates/repo/clone_buttons.tmpl b/templates/repo/clone_buttons.tmpl
index fb54b27c82..67a509835f 100644
--- a/templates/repo/clone_buttons.tmpl
+++ b/templates/repo/clone_buttons.tmpl
@@ -9,16 +9,7 @@
SSH
</button>
{{end}}
-<!-- the value will be updated by initRepoCloneLink, the code below is used to avoid UI flicking -->
-<input id="repo-clone-url" value="" size="1" readonly>
-<script>
- (() => {
- const proto = localStorage.getItem('repo-clone-protocol') || 'https';
- const btn = document.getElementById(`repo-clone-${proto}`);
- // it's ok if we don't find the btn here, initRepoCloneLink will take care of it
- document.getElementById('repo-clone-url').value = btn ? btn.getAttribute('data-link') : '';
- })();
-</script>
+<input id="repo-clone-url" class="js-clone-url" value="" size="1" readonly>
<button class="ui basic icon button tooltip" id="clipboard-btn" data-content="{{.locale.Tr "copy_url"}}" data-clipboard-target="#repo-clone-url" aria-label="{{.locale.Tr "copy_url"}}">
{{svg "octicon-paste"}}
</button>