From 82a2f0d5ec7c07152304af9f57da15c03b2a64ae Mon Sep 17 00:00:00 2001 From: Alexey <alexey.drupal@gmail.com> Date: Fri, 1 Sep 2023 18:10:33 +0200 Subject: [PATCH] #3384836: Replace deprecated jquery/once with core/once --- js/recurring_events_create_form.js | 6 +++--- js/recurring_events_date_form.js | 6 +++--- recurring_events.libraries.yml | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/js/recurring_events_create_form.js b/js/recurring_events_create_form.js index 969c17d6..6835c117 100644 --- a/js/recurring_events_create_form.js +++ b/js/recurring_events_create_form.js @@ -3,7 +3,7 @@ * Javascript functionality for the recurring events create form. */ -(function ($) { +(function ($, once) { 'use strict'; /** @@ -65,7 +65,7 @@ */ Drupal.behaviors.recurring_events_excluded_included_dates = { attach: function (context, settings) { - $('#edit-excluded-dates-wrapper, #edit-included-dates-wrapper').find('input.form-date').once().on('change', function (e) { + $(once('edit_excluded_date', $('#edit--dates-wrapper, #edit-included-dates-wrapper').find('input.form-date'))).on('change', function (e) { if ($(this).attr('name').includes('[value][date]')) { var start_date = this; var parent = $(this).closest('.form-wrapper'); @@ -81,4 +81,4 @@ } }; -}(jQuery)); +}(jQuery, once)); diff --git a/js/recurring_events_date_form.js b/js/recurring_events_date_form.js index 69ec49da..eb094bf6 100644 --- a/js/recurring_events_date_form.js +++ b/js/recurring_events_date_form.js @@ -3,7 +3,7 @@ * Javascript functionality for the included/excluded date forms. */ -(function ($) { +(function ($, once) { 'use strict'; /** @@ -12,7 +12,7 @@ Drupal.behaviors.recurring_events_excluded_included_config_dates = { attach: function (context, settings) { - $('#edit-start').once().on('change', function (e) { + $(once('edit_recurring_events_excluded_included_config_dates', $('#edit-start'))).on('change', function (e) { if ($('#edit-end').val() == '') { $('#edit-end').val($(this).val()); } @@ -20,4 +20,4 @@ } }; -}(jQuery)); +}(jQuery, once)); diff --git a/recurring_events.libraries.yml b/recurring_events.libraries.yml index 6950c953..cf6d3638 100644 --- a/recurring_events.libraries.yml +++ b/recurring_events.libraries.yml @@ -5,6 +5,7 @@ recurring_events.create_form: dependencies: - core/drupal - core/jquery + - core/once recurring_events.date_form: version: 1.x @@ -13,3 +14,4 @@ recurring_events.date_form: dependencies: - core/drupal - core/jquery + - core/once -- GitLab