Update Composer, update everything
This commit is contained in:
parent
ea3e94409f
commit
dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions
42
web/modules/contrib/webform/js/webform.element.composite.js
Normal file
42
web/modules/contrib/webform/js/webform.element.composite.js
Normal file
|
@ -0,0 +1,42 @@
|
|||
/**
|
||||
* @file
|
||||
* JavaScript behaviors for composite element builder.
|
||||
*/
|
||||
|
||||
(function ($, Drupal) {
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Initialize composite element builder.
|
||||
*
|
||||
* @type {Drupal~behavior}
|
||||
*/
|
||||
Drupal.behaviors.webformElementComposite = {
|
||||
attach: function (context) {
|
||||
$('[data-composite-types]').once('webform-composite-types').each(function () {
|
||||
var $element = $(this);
|
||||
var $type = $element.closest('tr').find('.js-webform-composite-type');
|
||||
|
||||
var types = $element.attr('data-composite-types').split(',');
|
||||
var required = $element.attr('data-composite-required');
|
||||
|
||||
$type.on('change', function () {
|
||||
if ($.inArray($(this).val(), types) === -1) {
|
||||
$element.hide();
|
||||
if (required) {
|
||||
$element.removeAttr('required aria-required');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$element.show();
|
||||
if (required) {
|
||||
$element.attr({'required': 'required', 'aria-required': 'true'});
|
||||
}
|
||||
}
|
||||
}).change();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery, Drupal);
|
Reference in a new issue