Webform module and config export

This commit is contained in:
Rob Davies 2017-03-16 15:29:07 +00:00
parent 3e6a5cbed2
commit 0e15467384
1040 changed files with 117682 additions and 0 deletions

View 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);