| Server IP : 65.108.144.40 / Your IP : 216.73.217.165 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 User : dev ( 1000) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/successkpi/wp-content/themes/successkpi/blocks/open-positions-block/ |
Upload File : |
document.addEventListener('DOMContentLoaded', function () {
// ── Accordion ──────────────────────────────────────────────
var answers = document.querySelectorAll('.have-answer');
answers.forEach(function (answer) {
answer.style.display = 'none';
});
document.querySelectorAll('.faq-question-title').forEach(function (title) {
title.addEventListener('click', function () {
var wrapper = this.closest('.faq-wrapper');
var answer = wrapper.querySelector('.have-answer');
var minusLine = wrapper.querySelector('.remove-to-close');
var isOpen = wrapper.classList.contains('is-open');
// Close all others
document.querySelectorAll('.faq-wrapper').forEach(function (w) {
w.querySelector('.have-answer').style.display = 'none';
w.classList.remove('is-open');
var line = w.querySelector('.remove-to-close');
if (line) line.style.display = 'block';
});
// Toggle clicked one
if (!isOpen) {
answer.style.display = 'block';
wrapper.classList.add('is-open');
if (minusLine) minusLine.style.display = 'none';
}
});
});
// ── Filter ─────────────────────────────────────────────────
var searchInput = document.querySelector('.search');
var locationSelect = document.querySelector('.select-control[data-placeholder="Location"]');
var departmentSelect = document.querySelector('.select-control[data-placeholder="Department"]');
var jobElements = document.querySelectorAll('.faq-wrapper');
function filterJobs() {
var searchQuery = searchInput ? searchInput.value.toLowerCase().trim() : '';
var selectedLocation = locationSelect ? locationSelect.value : '';
var selectedDepartment = departmentSelect ? departmentSelect.value : '';
jobElements.forEach(function (job) {
var jobTitle = (job.querySelector('.has-question') || {}).textContent || '';
var jobContent = (job.querySelector('.faq-answer') || {}).textContent || '';
var jobLocation = job.getAttribute('data-location') || '';
var jobDepartment = job.getAttribute('data-department') || '';
jobTitle = jobTitle.toLowerCase();
jobContent = jobContent.toLowerCase();
var matchesSearch = searchQuery === ''
|| jobTitle.includes(searchQuery)
|| jobContent.includes(searchQuery);
var matchesLocation = selectedLocation === ''
|| jobLocation.includes(selectedLocation);
var matchesDepartment = selectedDepartment === ''
|| jobDepartment.includes(selectedDepartment);
if (matchesSearch && matchesLocation && matchesDepartment) {
job.style.display = 'block';
} else {
job.style.display = 'none';
job.querySelector('.have-answer').style.display = 'none';
job.classList.remove('is-open');
}
});
}
if (searchInput) searchInput.addEventListener('input', filterJobs);
if (locationSelect) locationSelect.addEventListener('change', filterJobs);
if (departmentSelect) departmentSelect.addEventListener('change', filterJobs);
});