Webform module and config export
This commit is contained in:
parent
3e6a5cbed2
commit
0e15467384
1040 changed files with 117682 additions and 0 deletions
35
web/modules/contrib/webform/js/webform.element.buttons.js
Normal file
35
web/modules/contrib/webform/js/webform.element.buttons.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
/**
|
||||
* @file
|
||||
* Javascript behaviors for jQuery UI buttons element integration.
|
||||
*/
|
||||
|
||||
(function ($, Drupal) {
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Create jQuery UI buttons element.
|
||||
*
|
||||
* @type {Drupal~behavior}
|
||||
*/
|
||||
Drupal.behaviors.webformButtons = {
|
||||
attach: function (context) {
|
||||
$(context).find('.js-webform-buttons [type="radio"]').commonAncestor().once('webform-buttons').each(function () {
|
||||
var $input = $(this);
|
||||
// Remove all div and classes around radios and labels.
|
||||
$input.html($input.find('input[type="radio"], label').removeClass());
|
||||
// Create buttonset.
|
||||
$input.buttonset();
|
||||
// Disable buttonset.
|
||||
$input.buttonset('option', 'disabled', $input.find('input[type="radio"]:disabled').length);
|
||||
|
||||
// Turn buttonset off/on when the input is disabled/enabled.
|
||||
// @see webform.states.js
|
||||
$input.on('webform:disabled', function () {
|
||||
$input.buttonset('option', 'disabled', $input.find('input[type="radio"]:disabled').length);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery, Drupal);
|
Reference in a new issue