File: /var/www/quadcode/frontend/src/js/components/lp/affiliate_broker/affiliateBrokerLocaleStyle.js
const hashes = ['en', 'es', 'pt', 'th', 'vi'];
const hash = location.hash;
const block = document.body;
window.addEventListener('load', () => {
addStyleToOtherLang(hash);
});
window.addEventListener('hashchange', (e) => {
addStyleToOtherLang(location.hash);
});
function addStyleToOtherLang (hash) {
console.log(hash, hash.substring(1));
if (hashes.find((el) => el === hash.substring(1)) && hash.substring(1) !== 'en' ) {
block.classList.add('_locale');
}
else {
block.classList.remove('_locale');
}
}