Commit a92ec52d authored by  JosephK's avatar JosephK
Browse files

Fix pageLang undefined (grmpf) + iframe style

parent fd3b2b75
Pipeline #42693 failed with stages
in 28 seconds
...@@ -261,12 +261,15 @@ ...@@ -261,12 +261,15 @@
const referrer = (document.referrer.split('/')[2] !== undefined) ? document.referrer.split('/')[2] : ''; const referrer = (document.referrer.split('/')[2] !== undefined) ? document.referrer.split('/')[2] : '';
const iframe = document.createElement('iframe'); const iframe = document.createElement('iframe');
iframe.width = w; iframe.width = w; iframe.height = h;
iframe.height = h; iframe.frameborder = '0'; iframe.marginwidth = '0'; iframe.marginheight = '0';
iframe.style = `width: ${w}px; height: ${h}px;`; iframe.vspace = '0'; iframe.hspace = '0';
iframe.allowtransparency = 'true'; iframe.scrolling = 'no';
iframe.style = `width: ${w}px; height: ${h}px; border: none;`;
iframe.src = `${sense3Baseurl}sense3.html#${s.pageLang()};${tags};${colors};${id};${referrer}`; iframe.src = `${sense3Baseurl}sense3.html#${s.pageLang()};${tags};${colors};${id};${referrer}`;
iframe.className = 'sense3'; iframe.className = 'sense3';
iframe.id = `sense3_${i}`; iframe.id = `sense3_${i}`;
console.log(iframe);
if (!document.getElementById(`sense3_${i}`)) { if (!document.getElementById(`sense3_${i}`)) {
scripts[i].parentNode.insertBefore(iframe, scripts[i].nextSibling); scripts[i].parentNode.insertBefore(iframe, scripts[i].nextSibling);
} }
...@@ -418,9 +421,9 @@ ...@@ -418,9 +421,9 @@
lang = meta[i].getAttribute('content'); lang = meta[i].getAttribute('content');
} }
} }
} else {
lang = 'en';
} }
lang = (lang !== '' ) ? lang : 'en';
return lang.substr(0, 2).toLowerCase(); return lang.substr(0, 2).toLowerCase();
}, },
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment