Skip to content

Commit

Permalink
feat(ui): don't display copy button if no js
Browse files Browse the repository at this point in the history
  • Loading branch information
astyled committed Sep 12, 2023
1 parent f43c0e0 commit ea53884
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions web/typescript/page/view-style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ function shareButton() {
if (!shareButton) {
return;
}
shareButton.removeAttribute("hidden");
shareButton.addEventListener('click', () => {
navigator.clipboard.writeText(urlValue).then(() => {
shareButton.classList.add('copied');
Expand Down
2 changes: 1 addition & 1 deletion web/views/style/view.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<button
aria-label="Copy Style URL to clipboard"
data-tooltip="Style URL has been copied to your clipboard."
id="btn-share" class="btn icon iflex ai:c">
id="btn-share" class="btn icon iflex ai:c" hidden>
{{ template "icons/copy" }} Copy
</button>
</div>
Expand Down

0 comments on commit ea53884

Please sign in to comment.