ldc-ovoteam/public/modules/contrib/webform/js/webform.element.options.js
2024-02-06 10:27:42 +01:00

26 lines
674 B
JavaScript

/**
* @file
* JavaScript behaviors for options elements.
*/
(function ($, Drupal) {
'use strict';
/**
* Attach handlers to options buttons element.
*
* @type {Drupal~behavior}
*/
Drupal.behaviors.webformOptionsButtons = {
attach: function (context) {
// Place <input> inside of <label> before the label.
$(context).find('label.webform-options-display-buttons-label > input[type="checkbox"], label.webform-options-display-buttons-label > input[type="radio"]').each(function () {
var $input = $(this);
var $label = $input.parent();
$input.detach().insertBefore($label);
});
}
};
})(jQuery, Drupal);