Bugfix newsletter and footer scripts (#18853)
This commit is contained in:
1 parent
41750e1ada
commit
3a83237a6c
2 files changed
+7
-2
No files matched your search
Vendored
+1
-1
@@ -259,7 +259,7 @@ function initBenchmarkPickers() {
|
||||
function addFooter() {
|
||||
const footerAnchor = $('.footer');
|
||||
|
||||
fetch('../footer.html').then((response) => response.text()).then((text) => {
|
||||
fetch('/footer.html').then((response) => response.text()).then((text) => {
|
||||
const footerContent = $(text);
|
||||
footerAnchor.append(footerContent);
|
||||
});
|
||||
|
||||
Vendored
+6
-1
@@ -4,6 +4,11 @@ newsletterFieldPrefix = 'newsletter-'
|
||||
// debug url
|
||||
// const eloquaUrl = 'https://httpbingo.org/post'
|
||||
|
||||
const currentPath = window.location.pathname.slice(1).split('/');
|
||||
const newsletterModalPathVersion = (['cn', 'jp'].includes(currentPath[0])) ?
|
||||
`/${currentPath[0]}/${currentPath[1]}` :
|
||||
`/${currentPath[0]}`;
|
||||
const newsletterModalPath = newsletterModalPathVersion + '/_static/html/newsletter.html';
|
||||
|
||||
$(document).ready(function () {
|
||||
const waitForElement = async selector => {
|
||||
@@ -23,7 +28,7 @@ $(document).ready(function () {
|
||||
// });
|
||||
|
||||
function showForm() {
|
||||
fetch('_static/html/newsletter.html').then((response) => response.text()).then((text) => {
|
||||
fetch(newsletterModalPath).then((response) => response.text()).then((text) => {
|
||||
const newsletter = $('<div>');
|
||||
newsletter.attr('id', 'newsletterModal');
|
||||
newsletter.addClass('newsletterContainer');
|
||||
|
||||
Reference in new issue
Block a user