Nintex templates download as I was investigating some issue with their search bar. In the header file, if you have multiple '<input' (like we would normally do for language switcher options) it negates the button being clickable at all.
This commit is contained in:
@ -0,0 +1,84 @@
|
||||
<script src="https://unpkg.com/embla-carousel/embla-carousel.umd.js"></script>
|
||||
<script src="https://unpkg.com/embla-carousel-autoplay/embla-carousel-autoplay.umd.js"></script>
|
||||
|
||||
<script>
|
||||
// Function to update footer placeholder heights
|
||||
function updateFooterPlaceholders() {
|
||||
const cards = document.querySelectorAll('.nintex-card');
|
||||
cards.forEach(card => {
|
||||
const footer = card.querySelector('.nintex-card-footer');
|
||||
const placeholder = card.querySelector('.nintex-card-footer-placeholder');
|
||||
if (footer && placeholder) {
|
||||
const footerHeight = footer.getBoundingClientRect().height;
|
||||
placeholder.style.height = `${footerHeight}px`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Create ResizeObserver instance
|
||||
const resizeObserver = new ResizeObserver(entries => {
|
||||
// Update heights when any observed element resizes
|
||||
updateFooterPlaceholders();
|
||||
});
|
||||
|
||||
// Function to initialize observers for all cards
|
||||
function initializeObservers() {
|
||||
const cards = document.querySelectorAll('.nintex-card');
|
||||
cards.forEach(card => {
|
||||
const footer = card.querySelector('.nintex-card-footer');
|
||||
if (footer) {
|
||||
resizeObserver.observe(footer);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Initialize on DOM content loaded
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
initializeObservers();
|
||||
updateFooterPlaceholders(); // Initial update
|
||||
});
|
||||
|
||||
// Re-initialize when new cards might be added (e.g., after AJAX loads)
|
||||
document.addEventListener('contentChanged', () => {
|
||||
initializeObservers();
|
||||
updateFooterPlaceholders();
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
let lang = '{{current_person.properties.preferred_language}}'
|
||||
const langFromQuery = window.location.search.split('lang=')[1];
|
||||
if (langFromQuery) {
|
||||
lang = langFromQuery;
|
||||
}
|
||||
const style = document.createElement('style');
|
||||
|
||||
// Define all supported languages
|
||||
const supportedLanguages = ['en-US', 'es', 'fr', 'de', 'en-GB', 'nl', 'pt-BR'];
|
||||
|
||||
// If current language is not supported, default to en-US
|
||||
if (!supportedLanguages.includes(lang)) {
|
||||
lang = 'en-US';
|
||||
}
|
||||
|
||||
// Hide all languages except the current one
|
||||
const languagesToHide = supportedLanguages.filter(langCode => langCode !== lang);
|
||||
let cssContent = '';
|
||||
|
||||
languagesToHide.forEach(langCode => {
|
||||
cssContent += `
|
||||
.lang-${langCode} {
|
||||
display: none !important;
|
||||
visibility: hidden !important;
|
||||
opacity: 0 !important;
|
||||
}
|
||||
`;
|
||||
});
|
||||
|
||||
|
||||
style.textContent = cssContent;
|
||||
document.head.appendChild(style);
|
||||
|
||||
</script>
|
||||
|
||||
{% body %}
|
||||
Reference in New Issue
Block a user