Webform module and config export
This commit is contained in:
parent
3e6a5cbed2
commit
0e15467384
1040 changed files with 117682 additions and 0 deletions
39
web/modules/contrib/webform/js/webform.element.roles.js
Normal file
39
web/modules/contrib/webform/js/webform.element.roles.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
/**
|
||||
* @file
|
||||
* Javascript behaviors for roles element integration.
|
||||
*/
|
||||
|
||||
(function ($, Drupal) {
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Enhance roles element.
|
||||
*
|
||||
* @type {Drupal~behavior}
|
||||
*/
|
||||
Drupal.behaviors.webformRoles = {
|
||||
attach: function (context) {
|
||||
$(context).find('.js-webform-roles-role[value="authenticated"]').once('webform-roles').each(function () {
|
||||
var $authenticated = $(this);
|
||||
var $checkboxes = $authenticated.parents('.form-checkboxes').find('.js-webform-roles-role').filter(function () {
|
||||
return ($(this).val() != 'anonymous' && $(this).val() != 'authenticated');
|
||||
});
|
||||
|
||||
$authenticated.on('click', function () {
|
||||
if ($authenticated.is(':checked')) {
|
||||
$checkboxes.prop('checked', true).attr('disabled', true);
|
||||
}
|
||||
else {
|
||||
$checkboxes.prop('checked', false).removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
if ($authenticated.is(':checked')) {
|
||||
$checkboxes.prop('checked', true).attr('disabled', true);
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery, Drupal);
|
Reference in a new issue