mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 09:54:30 +01:00
Fix invoice popup not showing up if btcpay has a rootpath
This commit is contained in:
parent
3c7d93e88d
commit
2138b7dcb8
@ -1,5 +1,6 @@
|
||||
/* jshint browser: true, strict: false, maxlen: false, maxstatements: false */
|
||||
(function () {
|
||||
var showingInvoice = false;
|
||||
var supportsCurrentScript = ("currentScript" in document);
|
||||
var thisScript = "";
|
||||
if (supportsCurrentScript) {
|
||||
@ -65,6 +66,7 @@
|
||||
function hideFrame() {
|
||||
onModalWillLeaveMethod();
|
||||
iframe.style.display = 'none';
|
||||
showingInvoice = false;
|
||||
iframe = window.document.body.removeChild(iframe);
|
||||
}
|
||||
|
||||
@ -79,7 +81,7 @@
|
||||
function receiveMessage(event) {
|
||||
var uri;
|
||||
|
||||
if (origin !== event.origin) {
|
||||
if (!origin.startsWith(event.origin) || !showingInvoice) {
|
||||
return;
|
||||
}
|
||||
if (event.data === 'close') {
|
||||
@ -100,6 +102,7 @@
|
||||
}
|
||||
|
||||
function showInvoice(invoiceId, params) {
|
||||
showingInvoice = true;
|
||||
window.document.body.appendChild(iframe);
|
||||
var invoiceUrl = origin + '/invoice?id=' + invoiceId + '&view=modal';
|
||||
if (params && params.animateEntrance === false) {
|
||||
|
Loading…
Reference in New Issue
Block a user