-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add browser tooltip to Copy Game (URL) button
Add "Copy URL to Clipboard" browser tooltip to the Game Number + Copy button. Also, DRY up this view code so the change can be made in just one place. We do so by creating a layout partial in app/view/application so that it is highly reusable.
- Loading branch information
Showing
5 changed files
with
37 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<%# locals: (value:, title: "Copy to Clipboard") %> | ||
|
||
<span | ||
data-controller="clipboard" | ||
data-clipboard-source-value="<%= value %>" | ||
data-clipboard-highlight-class="text-green-500 animate-ping-once origin-center" | ||
class="flex gap-x-2 items-center" | ||
> | ||
<%= yield %> | ||
|
||
<%= inline_svg_tag( | ||
"heroicons/clipboard-document.svg", | ||
title:, | ||
data: { | ||
action: | ||
"click->clipboard#copy "\ | ||
"animationend->clipboard#dehighlight", | ||
}, | ||
class: "btn-basic") %> | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters