Skip to content
Snippets Groups Projects
Commit 901cb735 authored by Kelly's avatar Kelly
Browse files

Issue #3384369: Drupal 10 compatibility

parent 848be7b0
No related branches found
No related tags found
1 merge request!1Issue #3384369: Drupal 10 compatibility
......@@ -10,11 +10,13 @@
segments.each(function() {
// Add click once for each segment.
$(this).once('previewFieldBehavior').on('click', function() {
// If checked, uncheck all the other checkboxes.
if (this.checked) {
segments.not(this).prop('checked', false);
}
once('previewFieldBehavior', $(this)).forEach(function (element) {
$(element).on('click', function() {
// If checked, uncheck all the other checkboxes.
if (this.checked) {
segments.not(this).prop('checked', false);
}
});
});
});
}
......
diff --git a/js/form-preview-field.js b/js/form-preview-field.js
index 913334d..eb525eb 100644
--- a/js/form-preview-field.js
+++ b/js/form-preview-field.js
@@ -10,11 +10,13 @@
segments.each(function() {
// Add click once for each segment.
- $(this).once('previewFieldBehavior').on('click', function() {
- // If checked, uncheck all the other checkboxes.
- if (this.checked) {
- segments.not(this).prop('checked', false);
- }
+ once('previewFieldBehavior', $(this)).forEach(function (element) {
+ $(element).on('click', function() {
+ // If checked, uncheck all the other checkboxes.
+ if (this.checked) {
+ segments.not(this).prop('checked', false);
+ }
+ });
});
});
}
diff --git a/smart_content_preview.info.yml b/smart_content_preview.info.yml
index 7dfbf9c..94bb043 100644
--- a/smart_content_preview.info.yml
+++ b/smart_content_preview.info.yml
@@ -1,7 +1,7 @@
name: 'Smart Content Preview'
type: module
description: 'Choose which Smart Content segments to pass in order to preview.'
-core_version_requirement: ^8 || ^9
+core_version_requirement: ^8 || ^9 || ^10
package: Smart Content
dependencies:
- smart_content
diff --git a/smart_content_preview.libraries.yml b/smart_content_preview.libraries.yml
index 01d2ad2..e451576 100644
--- a/smart_content_preview.libraries.yml
+++ b/smart_content_preview.libraries.yml
@@ -3,4 +3,4 @@ form_preview_field:
js/form-preview-field.js: {}
dependencies:
- core/jquery
- - core/jquery.once
+ - core/once
name: 'Smart Content Preview'
type: module
description: 'Choose which Smart Content segments to pass in order to preview.'
core_version_requirement: ^8 || ^9
core_version_requirement: ^8 || ^9 || ^10
package: Smart Content
dependencies:
- smart_content
......@@ -3,4 +3,4 @@ form_preview_field:
js/form-preview-field.js: {}
dependencies:
- core/jquery
- core/jquery.once
- 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