/** * @file * JavaScript behaviors for options elements. */ (function ($, Drupal) { /** * Attach handlers to options buttons element. * * @type {Drupal~behavior} */ Drupal.behaviors.webformOptionsButtons = { attach(context) { // Place inside of 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);