Example modal in invoice list (#387)

This commit is contained in:
Rockstar Developer 2018-11-09 02:13:45 -06:00 committed by Nicolas Dorier
parent f23e2a3ec4
commit cfdf8b1670
3 changed files with 17 additions and 14 deletions

View file

@ -1,6 +1,15 @@
@model InvoicesModel
@{
ViewData["Title"] = "Invoices";
var rootUrl = Context.Request.GetAbsoluteRoot();
}
@section HeadScripts {
<script src="~/modal/btcpay.js"></script>
<script type="text/javascript">
btcpay.setApiUrlPrefix("@rootUrl");
</script>
}
<section>
@ -107,8 +116,13 @@
<td style="text-align:right">
@if (invoice.ShowCheckout)
{
<a asp-action="Checkout" asp-route-invoiceId="@invoice.InvoiceId">Checkout</a> <span>-</span>
}<a asp-action="Invoice" asp-route-invoiceId="@invoice.InvoiceId">Details</a>
<span>
<a asp-action="Checkout" asp-route-invoiceId="@invoice.InvoiceId">Checkout</a>
<a href="javascript:btcpay.showInvoice('@invoice.InvoiceId')">[^]</a>
-
</span>
}
<a asp-action="Invoice" asp-route-invoiceId="@invoice.InvoiceId">Details</a>
</td>
</tr>
}

View file

@ -22,7 +22,7 @@
iframe.style.left = 0;
iframe.style.height = '100%';
iframe.style.width = '100%';
iframe.style.zIndex = '1000';
iframe.style.zIndex = '2000';
var origin = 'http://slack.btcpayserver.org join us there, and initialize this with your origin url through setApiUrlPrefix';
// urlPrefix should be site root without trailing slash

View file

@ -1,11 +0,0 @@
<html>
<head>
<script src="btcpay.js"></script>
<script type="text/javascript">
btcpay.setApiUrlPrefix("http://127.0.0.1:14142");
</script>
</head>
<body>
<button onclick="btcpay.showInvoice('25DKDgcB4z4PtkPJyHVYnV')">Open Modal</button>
</body>
</html>