Widget: Guard against missing xhr.responseURL in Internet Explorer

This commit is contained in:
Raphael Michel
2019-01-30 12:12:25 +01:00
parent 87424c25de
commit 9e43459879

View File

@@ -409,7 +409,7 @@ var shared_methods = {
} }
}, },
buy_error_callback: function (xhr, data) { buy_error_callback: function (xhr, data) {
if (xhr.status === 405) { if (xhr.status === 405 && typeof xhr.responseURL !== "undefined") {
// Likely a redirect! // Likely a redirect!
this.$root.event_url = xhr.responseURL.substr(0, xhr.responseURL.indexOf("/cart/add") - 18); this.$root.event_url = xhr.responseURL.substr(0, xhr.responseURL.indexOf("/cart/add") - 18);
this.$root.overlay.frame_loading = false; this.$root.overlay.frame_loading = false;
@@ -687,7 +687,7 @@ var shared_root_methods = {
} }
var root = this.$root; var root = this.$root;
api._getJSON(url, function (data, xhr) { api._getJSON(url, function (data, xhr) {
if (xhr.responseURL !== url) { if (typeof xhr.responseURL !== "undefined" && xhr.responseURL !== url) {
var new_url = xhr.responseURL.substr(0, xhr.responseURL.indexOf("/widget/product_list?") + 1); var new_url = xhr.responseURL.substr(0, xhr.responseURL.indexOf("/widget/product_list?") + 1);
if (root.subevent) { if (root.subevent) {
new_url = new_url.substr(0, new_url.lastIndexOf("/", new_url.length - 1) + 1); new_url = new_url.substr(0, new_url.lastIndexOf("/", new_url.length - 1) + 1);