mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-11-27 06:30:19 +01:00
fixed copy to clipboard
This commit is contained in:
parent
7249b90d7c
commit
9f87fb789f
2 changed files with 5 additions and 12 deletions
|
@ -51,15 +51,7 @@ include "includes/head.html"
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
<a href="#" id="copy-link-btn" class="btn-cta btn">copy link</a>
|
||||
<a href="{{.Url}}" class="btn-cta btn"> download</i> </a>
|
||||
|
||||
<div id="copy-link-wrapper" class="copy-link-wrapper">
|
||||
<p>Press Ctrl / CMD + C to copy link to your clipboard.</p>
|
||||
<input readonly="readonly" type="text" value="{{.Url}}" />
|
||||
</div>
|
||||
<div id="overlay" class="overlay"></div>
|
||||
</div>
|
||||
include "includes/download-btn.html"
|
||||
</section>
|
||||
|
||||
|
||||
|
|
|
@ -109,6 +109,7 @@ $(document).ready(function() {
|
|||
copylink = document.getElementById("copy-link-wrapper"),
|
||||
overlay = document.getElementById("overlay");
|
||||
|
||||
var url = "http://url"
|
||||
copylinkbtn.addEventListener("click", function() {
|
||||
|
||||
var error = document.getElementsByClassName('error');
|
||||
|
@ -119,9 +120,9 @@ $(document).ready(function() {
|
|||
|
||||
document.body.className += ' active';
|
||||
|
||||
copylink.children[2].value = window.location.href;
|
||||
copylink.children[2].focus();
|
||||
copylink.children[2].select();
|
||||
copylink.children[1].value = url;
|
||||
copylink.children[1].focus();
|
||||
copylink.children[1].select();
|
||||
}, false);
|
||||
|
||||
overlay.addEventListener("click", function() {
|
||||
|
|
Loading…
Reference in a new issue