Skip to content
Snippets Groups Projects
Commit 82a2f0d5 authored by Alexey's avatar Alexey
Browse files

#3384836: Replace deprecated jquery/once with core/once

parent 1d25fc9d
No related branches found
No related tags found
1 merge request!75feat: [#3384836]: Replace deprecated jquery/once with core/once
......@@ -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));
......@@ -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));
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment