Skip to content

Commit

Permalink
Change text to "Copied" for more visual feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Nov 21, 2021
1 parent 2e9bf87 commit 002d772
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ $(document).ready(async function() {

const feed_modal = $("#feed-modal");
const feed_url = $("#feed-url");
feed_url.val(url);
feed_url.val(url).trigger("input");
feed_modal.modal("show", this);
feed_url.select();

Expand All @@ -190,6 +190,11 @@ $(document).ready(async function() {
const feed_url = $("#feed-url");
feed_url.select();
navigator.clipboard.writeText(feed_url.val());
this.textContent = "Copied";
});

$("#feed-url").on("input", function() {
$("#copy-button").text("Copy");
});

$("#feed-modal form").submit(function(event) {
Expand All @@ -204,7 +209,7 @@ $(document).ready(async function() {
if (qs != "") {
url += `?${qs}`;
}
$("#feed-url").val(url).select();
$("#feed-url").val(url).trigger("input").select();
});

$("[data-download-filename]").click(async function() {
Expand Down

0 comments on commit 002d772

Please sign in to comment.