Preserves the advanced search query parameters when using both the advanced search module and the nouislider module.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

26 lines
811 B

<?php
/**
* @file
* Preserves advanced search a[] parameters on facet slider URLs.
*/
/**
* Implements hook_library_info_alter().
*
* Attaches the fix-up library as a dependency of the slider widget library
* rather than to every page. This scopes it to the pages that actually render
* a slider, and guarantees our script loads first so the behavior is
* registered — and therefore runs — before the slider reads
* drupalSettings.facets.sliders.
*/
function preserve_advanced_search_library_info_alter(array &$libraries, $extension)
{
if ($extension !== 'facets_range_nouislider') {
return;
}
if (isset($libraries['facets_range_nouislider'])) {
$libraries['facets_range_nouislider']['dependencies'][] = 'preserve_advanced_search/preserve-advanced-search';
}
}