diff options
| -rw-r--r-- | static/js/app.js | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/static/js/app.js b/static/js/app.js index 27a9353..5b1ddec 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -81,26 +81,26 @@ document.addEventListener('DOMContentLoaded', function () { link.textContent = response.files[0].url.replace(/.*?:\/\//g, ''); link.href = response.files[0].url; url.appendChild(link); - var copy = document.createElement('button'); - copy.className = 'upload-clipboard-btn'; - var glyph = document.createElement('img'); - glyph.src = 'img/glyphicons-512-copy.png'; - copy.appendChild(glyph); - url.appendChild(copy); - copy.addEventListener("click", function(event) { - /*why create element? text needs to be on screen to be selected - and thus copied. only text we have on screen is the link without - the http[s]:// part. so this creates an element with the full link - for a moment and then deletes. */ - var element = document.createElement('a'); - element.textContent = response.files[0].url; - link.appendChild(element); - var range = document.createRange(); - range.selectNode(element); - window.getSelection().addRange(range); - document.execCommand("copy"); - link.removeChild(element); - }); + var copy = document.createElement('button'); + copy.className = 'upload-clipboard-btn'; + var glyph = document.createElement('img'); + glyph.src = 'img/glyphicons-512-copy.png'; + copy.appendChild(glyph); + url.appendChild(copy); + copy.addEventListener("click", function(event) { + /*why create element? text needs to be on screen to be selected + and thus copied. only text we have on screen is the link without + the http[s]:// part. so this creates an element with the full link + for a moment and then deletes. */ + var element = document.createElement('a'); + element.textContent = response.files[0].url; + link.appendChild(element); + var range = document.createRange(); + range.selectNode(element); + window.getSelection().addRange(range); + document.execCommand("copy"); + link.removeChild(element); + }); } else { bar.innerHTML = 'Error: ' + response.description; } |
