@postnord/pn-marketweb-components 2.0.71 → 2.0.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/umd/pn-marketweb-salesforce.js +16 -12
package/package.json
CHANGED
|
@@ -24,19 +24,19 @@
|
|
|
24
24
|
|
|
25
25
|
const s = document.createElement('script');
|
|
26
26
|
s.setAttribute("type", "module");
|
|
27
|
-
s.setAttribute("src", "https://cdn.jsdelivr.net/npm/@postnord/pn-marketweb-components@2.0.
|
|
27
|
+
s.setAttribute("src", "https://cdn.jsdelivr.net/npm/@postnord/pn-marketweb-components@2.0.72/umd/standalone-loader-salesforce.js");
|
|
28
28
|
document.querySelector("head").appendChild(s);
|
|
29
29
|
|
|
30
30
|
const style = document.createElement('link');
|
|
31
31
|
style.setAttribute("rel", "stylesheet");
|
|
32
|
-
style.setAttribute("href", "https://cdn.jsdelivr.net/npm/@postnord/pn-marketweb-components@2.0.
|
|
32
|
+
style.setAttribute("href", "https://cdn.jsdelivr.net/npm/@postnord/pn-marketweb-components@2.0.72/umd/pn-marketweb-wrongrembase.css");
|
|
33
33
|
document.querySelector("head").appendChild(style);
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
window["bindLanguageSelector"] = function() {
|
|
36
|
+
if (window["haslangchange"]) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
window.addEventListener('marketweb-languagechange', (e) => {
|
|
40
40
|
let lang = e.detail;
|
|
41
41
|
if (lang === "en") {
|
|
42
42
|
lang = "en_US";
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
const queryParams = new URLSearchParams(window.location.search);
|
|
45
45
|
const currentLanguageValue = queryParams.get("language");
|
|
46
46
|
if (currentLanguageValue === lang) {
|
|
47
|
-
|
|
47
|
+
return;
|
|
48
48
|
}
|
|
49
49
|
queryParams.set("language", lang);
|
|
50
50
|
let newUrl = window.location.origin + window.location.pathname + '?'+ queryParams.toString();
|
|
@@ -56,12 +56,16 @@
|
|
|
56
56
|
newUrl = newUrl.replace("-en-", "-da-");
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
console.log('newUrl', newUrl)
|
|
60
60
|
window.location.href = newUrl;
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
});
|
|
62
|
+
window["haslangchange"] = true;
|
|
63
|
+
};
|
|
64
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
65
|
+
window["bindLanguageSelector"]();
|
|
63
66
|
}
|
|
64
|
-
|
|
67
|
+
);
|
|
68
|
+
window.setTimeout(() => { window["bindLanguageSelector"](); }, 200);
|
|
65
69
|
window["renderpncomponent-interval"] = window.setInterval(renderPNComponents,150);
|
|
66
70
|
renderPNComponents();
|
|
67
71
|
})();
|