mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Widget: fix broken iframe detection
This commit is contained in:
@@ -39,7 +39,7 @@ class ContactForm(forms.Form):
|
||||
help_text=_('Please enter the same email address again to make sure you typed it correctly.')
|
||||
)
|
||||
|
||||
if self.request.session.get('iframe_session', False):
|
||||
if not self.request.session.get('iframe_session', False):
|
||||
# There is a browser quirk in Chrome that leads to incorrect initial scrolling in iframes if there
|
||||
# is an autofocus field. Who would have thought… See e.g. here:
|
||||
# https://floatboxjs.com/forum/topic.php?post=8440&usebb_sid=2e116486a9ec6b7070e045aea8cded5b#post8440
|
||||
|
||||
@@ -406,7 +406,12 @@ var shared_methods = {
|
||||
if (data.redirect.substr(0, 1) === '/') {
|
||||
data.redirect = this.$root.event_url.replace(/^([^\/]+:\/\/[^\/]+)\/.*$/, "$1") + data.redirect;
|
||||
}
|
||||
var url = data.redirect + '?iframe=1&locale=' + lang + '&take_cart_id=' + this.$root.cart_id;
|
||||
var url = data.redirect;
|
||||
if (url.indexOf('?')) {
|
||||
url = url + '&iframe=1&locale=' + lang + '&take_cart_id=' + this.$root.cart_id;
|
||||
} else {
|
||||
url = url + '?iframe=1&locale=' + lang + '&take_cart_id=' + this.$root.cart_id;
|
||||
}
|
||||
if (data.success === false) {
|
||||
url = url.replace(/checkout\/start/g, "");
|
||||
this.$root.error_message = data.message;
|
||||
|
||||
Reference in New Issue
Block a user