- News & Blogs
Discover Redpack's latest developments, innovations, and global machinery showcases
Filter by
.elementor-state-disabled { pointer-events: none; opacity: 0.5; } jQuery(document).ready(function($) { if (!window.elementorFrontend || !window.elementorFrontend.isEditMode()) { // Function to reload the page without query parameters function reloadWithoutQueryParams() { if (window.location.search) { // Only reload if there are query parameters in the URL window.location = window.location.pathname; } } // Function to toggle button state based on aria-pressed presence function toggleButtonState() { if ($('[aria-pressed="true"]').length > 0) { // Enable the button if aria-pressed="true" exists $('#clear-filter-blogs a').removeClass('elementor-state-disabled'); } else { // Disable the button if aria-pressed="true" does not exist $('#clear-filter-blogs a').addClass('elementor-state-disabled'); } } // Run the function on page load toggleButtonState(); // Use MutationObserver to detect changes in aria-pressed attributes dynamically const observer = new MutationObserver(function(mutationsList) { for (let mutation of mutationsList) { if (mutation.type === 'attributes' && mutation.attributeName === 'aria-pressed') { // Re-check and update button state if aria-pressed changes toggleButtonState(); } } }); // Observe all elements with aria-pressed attribute for changes $('[aria-pressed]').each(function() { observer.observe(this, { attributes: true }); }); // Reload the page without query parameters only if needed reloadWithoutQueryParams(); } });