From c6bcd05404c25e55e54654ead0a8976c0e20410a Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Sat, 1 Feb 2020 15:39:03 +0100 Subject: [PATCH] Widget: Fix button behaviour without iframe --- .../static/pretixpresale/js/widget/widget.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/pretix/static/pretixpresale/js/widget/widget.js b/src/pretix/static/pretixpresale/js/widget/widget.js index 4d5dc4b8e..843e53384 100644 --- a/src/pretix/static/pretixpresale/js/widget/widget.js +++ b/src/pretix/static/pretixpresale/js/widget/widget.js @@ -1036,9 +1036,11 @@ Vue.component('pretix-widget', { Vue.component('pretix-button', { template: ('
' + '
' - + '
' + + '' + '' + + '' + '' + + '' + '' + '' + '' @@ -1204,7 +1206,20 @@ var shared_root_computed = { } return form_target; }, + formMethod: function () { + if (!this.useIframe && this.is_button && this.items.length === 0) { + return 'get'; + } + return 'post'; + }, formTarget: function () { + if (!this.useIframe && this.is_button && this.items.length === 0) { + var target = this.target_url; + if (this.voucher_code) { + target = this.target_url + 'redeem'; + } + return target; + } var checkout_url = "/" + this.target_url.replace(/^[^\/]+:\/\/([^\/]+)\//, "") + "w/" + widget_id + "/"; if (!this.$root.cart_exists) { checkout_url += "checkout/start";