Skip to content
Snippets Groups Projects
Commit fd79c5f5 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Fixed css issues

parent 5b02d518
No related branches found
No related tags found
No related merge requests found
...@@ -11,9 +11,12 @@ ...@@ -11,9 +11,12 @@
background: #333333 background: #333333
border-radius: 4px border-radius: 4px
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4)
p
color: #ffffff
div
display: flex display: flex
flex-direction: row flex-direction: row
#url-field input
background: none background: none
color: #fff color: #fff
border: none border: none
...@@ -23,7 +26,7 @@ ...@@ -23,7 +26,7 @@
width: 0 width: 0
margin: 8px margin: 8px
text-overflow: ellipsis text-overflow: ellipsis
#copy-url button.copy
display: block display: block
background: #FFC107 background: #FFC107
padding: 4px 16px padding: 4px 16px
......
...@@ -34,20 +34,32 @@ ...@@ -34,20 +34,32 @@
</form> </form>
</div> </div>
{{end}} {{end}}
<div class="url"> <div class="url">
<input id="url-field" type="text" value="https://i.k8r.eu/{{.Image.Id}}"> <p>Detail Page</p>
<button id="copy-url">Copy</button> <div>
<input id="url_full" type="text" value="https://i.k8r.eu/i/{{.Image.Id}}">
<button class="copy" data-target="#url_full">Copy</button>
</div>
</div>
<div class="url">
<p>Direct Link</p>
<div>
<input id="url_direct" type="text" value="https://i.k8r.eu/{{.Image.Id}}">
<button class="copy" data-target="#url_direct">Copy</button>
</div>
</div> </div>
</div> </div>
</div> </div>
<script> <script>
const urlCopyButton = document.getElementById("copy-url"); Array.prototype.slice.call(document.querySelectorAll("button.copy[data-target]")).forEach((button) => {
const urlField = document.getElementById("url-field"); const target = document.querySelector(button.dataset["target"]);
urlCopyButton.addEventListener("click", () => { if (target) {
urlField.select(); button.addEventListener("click", () => {
target.select();
document.execCommand("Copy"); document.execCommand("Copy");
}) })
}
});
</script> </script>
{{if .IsMine}} {{if .IsMine}}
<script> <script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment