Commit 4d35ea02 authored by Clint.Network's avatar Clint.Network

Copy to Clipboard feature #18

parent 12d5dfab
......@@ -32,7 +32,7 @@
<td><strong>Address</strong></td>
<td>
<a class="to-copy" asp-controller="BlockExplorer" asp-action="Address" asp-route-address="@Model.address">@Model.address</a>
<a href="#" class="copy-me"><i class="fa fa-copy"></i></a>
<a href="#" data-value="@Model.address" class="copy-me"><i class="fa fa-copy"></i></a>
</td>
</tr>
<tr>
......@@ -108,3 +108,20 @@
</div>
</div>
</section>
@section Scripts
{
<script type="text/javascript">
$(document).ready(function()
{
$(".copy-me").click(function()
{
var tempField = document.createElement("textarea");
tempField.value = $(this).attr("data-value");
$("body").parent().append(tempField);
tempField.select();
document.execCommand("copy");
tempField.remove();
})
});
</script>
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment