Commit 79d77630 authored by Markus Kalkbrenner's avatar Markus Kalkbrenner Committed by Markus Kalkbrenner
Browse files

Issue #3297168 by mkalkbrenner, balintpekker: Automated Drupal 10 compatibility fixes

parent c6d0d73b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -177,6 +177,7 @@ function facets_update_8005() {
function facets_update_8006() {
  $query = \Drupal::entityQuery('block')
    ->condition('plugin', 'facet_block', 'STARTS_WITH')
    ->accessCheck()
    ->execute();

  foreach ($query as $block_id) {
+3 −3
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ drupal.facets.index-active-formatters:
  dependencies:
    - core/jquery
    - core/drupal
    - core/jquery.once
    - core/once

drupal.facets.edit-facet:
  version: VERSION
@@ -28,7 +28,7 @@ widget:
  dependencies:
    - core/jquery
    - core/drupal
    - core/jquery.once
    - core/once

drupal.facets.link-widget:
  version: VERSION
@@ -69,7 +69,7 @@ soft-limit:
    js/soft-limit.js: {}
  dependencies:
    - core/jquery
    - core/jquery.once
    - core/once
    - core/drupal
    - core/drupalSettings

+5 −8
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 * Provides base widget behaviours.
 */

(function ($, Drupal) {
(function ($, Drupal, once) {

  'use strict';

@@ -20,8 +20,7 @@
   *   filter is executed.
   *
   * This is an example how to trigger "facets_filter" event for your widget:
   *   $('.my-custom-widget.js-facets-widget')
   *     .once('my-custom-widget-on-change')
   *   $(once('my-custom-widget-on-change', '.my-custom-widget.js-facets-widget'))
   *     .on('change', function () {
   *       // In this example $(this).val() will provide needed URL.
   *       $(this).trigger('facets_filter', [ $(this).val() ]);
@@ -34,8 +33,7 @@
   * event before initial filter request is finished.
   *
   * This is an example how to handle "facets_filtering":
   *   $('.my-custom-widget.js-facets-widget')
   *     .once('my-custom-widget-on-facets-filtering')
   *   $(once('my-custom-widget-on-facets-filtering', '.my-custom-widget.js-facets-widget'))
   *     .on('facets_filtering.my_widget_module', function () {
   *       // Let's say, that widget can be simply disabled (fe. select).
   *       $(this).prop('disabled', true);
@@ -47,8 +45,7 @@
   */
  Drupal.behaviors.facetsFilter = {
    attach: function (context) {
      $('.js-facets-widget', context)
        .once('js-facet-filter')
      $(once('js-facet-filter', '.js-facets-widget', context))
        .on('facets_filter.facets', function (event, url) {
          $('.js-facets-widget').trigger('facets_filtering');

@@ -57,4 +54,4 @@
    }
  };

})(jQuery, Drupal);
})(jQuery, Drupal, once);
+3 −4
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 * Transforms links into checkboxes.
 */

(function ($, Drupal) {
(function ($, Drupal, once) {

  'use strict';

@@ -32,8 +32,7 @@
   */
  Drupal.facets.makeCheckboxes = function (context) {
    // Find all checkbox facet links and give them a checkbox.
    var $checkboxWidgets = $('.js-facets-checkbox-links', context)
      .once('facets-checkbox-transform');
    var $checkboxWidgets = $(once('facets-checkbox-transform', '.js-facets-checkbox-links', context));

    if ($checkboxWidgets.length > 0) {
      $checkboxWidgets.each(function (index, widget) {
@@ -126,4 +125,4 @@
    e.preventDefault();
  };

})(jQuery, Drupal);
})(jQuery, Drupal, once);
+3 −3
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 * Transforms links into a dropdown list.
 */

(function ($) {
(function ($, once) {

  'use strict';

@@ -24,7 +24,7 @@
   */
  Drupal.facets.makeDropdown = function (context, settings) {
    // Find all dropdown facet links and turn them into an option.
    $('.js-facets-dropdown-links').once('facets-dropdown-transform').each(function () {
    $(once('facets-dropdown-transform', '.js-facets-dropdown-links')).each(function () {
      var $ul = $(this);
      var $links = $ul.find('.facet-item a');
      var $dropdown = $('<select></select>');
@@ -101,4 +101,4 @@
    });
  };

})(jQuery);
})(jQuery, once);
Loading