Update Composer, update everything

This commit is contained in:
Oliver Davies 2018-11-23 12:29:20 +00:00
parent ea3e94409f
commit dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions

View file

@ -1,12 +1,21 @@
/**
* @file
* Javascript behaviors for jQuery UI buttons element integration.
* JavaScript behaviors for jQuery UI buttons (checkboxradio) element integration.
*/
(function ($, Drupal) {
'use strict';
Drupal.webform = Drupal.webform || {};
Drupal.webform.buttons = Drupal.webform.buttons || {};
Drupal.webform.buttons.selector = Drupal.webform.buttons.selector || [
// Applies to Classy, Bartik, and Seven themes.
'.js-webform-buttons .form-radios',
// Applies to Stable and Bootstrap themes.
'.js-webform-buttons .js-form-type-radio'
].join(',');
/**
* Create jQuery UI buttons element.
*
@ -14,19 +23,33 @@
*/
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);
$(context).find(Drupal.webform.buttons.selector).once('webform-buttons').each(function () {
var $buttons = $(this);
// Turn buttonset off/on when the input is disabled/enabled.
// Remove classes around radios and labels and move to main element.
$buttons.find('input[type="radio"], label').each(function () {
$buttons.append($(this).removeAttr('class'));
});
// Remove all empty div wrappers.
$buttons.find('div').remove();
// Must reset $buttons since the contents have changed.
$buttons = $(this);
// Get radios.
var $input = $buttons.find('input[type="radio"]');
// Create checkboxradio.
$input.checkboxradio({icon: false});
// Disable checkboxradio.
$input.checkboxradio('option', 'disabled', $input.is(':disabled'));
// Turn checkboxradio 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);
$input.checkboxradio('option', 'disabled', $input.is(':disabled'));
});
});
}