diff --git a/js/checkbox-widget.js b/js/checkbox-widget.js index 47744de..fe3ce87 100644 --- a/js/checkbox-widget.js +++ b/js/checkbox-widget.js @@ -43,7 +43,7 @@ checkbox.on('change.facets', function (e) { Drupal.facets.disableFacet($link.parents('.js-facets-checkbox-links')); - $(this).siblings('a').trigger('click'); + $(this).siblings('a')[0].click(); }); if (active) { diff --git a/js/dropdown-widget.js b/js/dropdown-widget.js index 03f7f2c..50771d8 100644 --- a/js/dropdown-widget.js +++ b/js/dropdown-widget.js @@ -69,7 +69,7 @@ // Go to the selected option when it's clicked. $dropdown.on('change.facets', function () { var a = $($ul).find("[data-drupal-facet-item-id='" + $(this).find(':selected').data('drupalFacetItemId') + "']"); - $(a).trigger('click'); + $(a)[0].click(); }); // Append empty text option. diff --git a/js/facets-views-ajax.js b/js/facets-views-ajax.js index 675889c..e14eb06 100644 --- a/js/facets-views-ajax.js +++ b/js/facets-views-ajax.js @@ -53,7 +53,7 @@ $('[data-drupal-facets-summary-id=' + facetSettings.facets_summary_id + ']').children('ul').children('li').once().click(function (e) { e.preventDefault(); var facetLink = $(this).find('a'); - updateFacetsView(facetLink, current_dom_id, view_path); + updateFacetsView(facetLink.attr('href'), current_dom_id, view_path); }); } // Update view on facet item click. diff --git a/modules/facets_summary/src/Plugin/Block/FacetsSummaryBlock.php b/modules/facets_summary/src/Plugin/Block/FacetsSummaryBlock.php index 62cbcfa..83612e0 100644 --- a/modules/facets_summary/src/Plugin/Block/FacetsSummaryBlock.php +++ b/modules/facets_summary/src/Plugin/Block/FacetsSummaryBlock.php @@ -5,6 +5,7 @@ namespace Drupal\facets_summary\Plugin\Block; use Drupal\Core\Block\BlockBase; use Drupal\Core\Cache\UncacheableDependencyTrait; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\Core\Url; use Drupal\facets_summary\Entity\FacetsSummary; use Drupal\facets_summary\FacetsSummaryBlockInterface; use Drupal\facets_summary\FacetsSummaryManager\DefaultFacetsSummaryManager; @@ -104,6 +105,7 @@ class FacetsSummaryBlock extends BlockBase implements FacetsSummaryBlockInterfac 'facets_summary_id' => $build['#attributes']['data-drupal-facets-summary-id'], 'view_id' => $view->id(), 'current_display_id' => $view->current_display, + 'ajax_path' => Url::fromRoute('views.ajax')->toString(), ], ]; diff --git a/src/Controller/FacetBlockAjaxController.php b/src/Controller/FacetBlockAjaxController.php index 8011c19..e624c09 100644 --- a/src/Controller/FacetBlockAjaxController.php +++ b/src/Controller/FacetBlockAjaxController.php @@ -167,7 +167,7 @@ class FacetBlockAjaxController extends ControllerBase { // Update filter summary block. if ($facet_summary_block_id) { $block_entity = $this->storage->load($facet_summary_block_id); - $block_view = $this->entityManager->getViewBuilder('block') + $block_view = $this->entityTypeManager->getViewBuilder('block') ->view($block_entity); /** @var \Drupal\Core\Render\Markup $block_view */ $block_view = (string) $this->renderer->renderPlain($block_view);