diff --git a/core/misc/machine-name.js b/core/misc/machine-name.js index 2b304bf..688c4b6 100644 --- a/core/misc/machine-name.js +++ b/core/misc/machine-name.js @@ -85,21 +85,21 @@ } Object.keys(settings.machineName).forEach(function (source_id) { var machine = ''; var eventData; var options = settings.machineName[source_id]; var $source = $context.find(source_id).addClass('machine-name-source').once('machine-name'); var $target = $context.find(options.target).addClass('machine-name-target'); var $suffix = $context.find(options.suffix); - var $wrapper = $target.closest('.form-item'); + var $wrapper = $target.closest('.js-form-item'); // All elements have to exist. if (!$source.length || !$target.length || !$suffix.length || !$wrapper.length) { return; } // Skip processing upon a form validation error on the machine name. if ($target.hasClass('error')) { return; } // Figure out the maximum length for the machine name. options.maxlength = $target.attr('maxlength'); diff --git a/core/misc/states.js b/core/misc/states.js index 9472848..b88145a 100644 --- a/core/misc/states.js +++ b/core/misc/states.js @@ -589,46 +589,46 @@ * bubble up to these handlers. We use this system so that themes and modules * can override these state change handlers for particular parts of a page. */ $(document).on('state:disabled', function (e) { // Only act when this change was triggered by a dependency and not by the // element monitoring itself. if (e.trigger) { $(e.target) .prop('disabled', e.value) - .closest('.form-item, .js-form-submit, .js-form-wrapper').toggleClass('form-disabled', e.value) + .closest('.js-form-item, .js-form-submit, .js-form-wrapper').toggleClass('form-disabled', e.value) .find('select, input, textarea').prop('disabled', e.value); // Note: WebKit nightlies don't reflect that change correctly. // See https://bugs.webkit.org/show_bug.cgi?id=23789 } }); $(document).on('state:required', function (e) { if (e.trigger) { if (e.value) { - var $label = $(e.target).attr({'required': 'required', 'aria-required': 'aria-required'}).closest('.form-item, .js-form-wrapper').find('label'); + var $label = $(e.target).attr({'required': 'required', 'aria-required': 'aria-required'}).closest('.js-form-item, .js-form-wrapper').find('label'); // Avoids duplicate required markers on initialization. if (!$label.hasClass('form-required').length) { $label.addClass('form-required'); } } else { - $(e.target).removeAttr('required aria-required').closest('.form-item, .js-form-wrapper').find('label.form-required').removeClass('form-required'); + $(e.target).removeAttr('required aria-required').closest('.js-form-item, .js-form-wrapper').find('label.form-required').removeClass('form-required'); } } }); $(document).on('state:visible', function (e) { if (e.trigger) { - $(e.target).closest('.form-item, .js-form-submit, .js-form-wrapper').toggle(e.value); + $(e.target).closest('.js-form-item, .js-form-submit, .js-form-wrapper').toggle(e.value); } }); $(document).on('state:checked', function (e) { if (e.trigger) { $(e.target).prop('checked', e.value); } }); $(document).on('state:collapsed', function (e) { diff --git a/core/modules/filter/filter.filter_html.admin.js b/core/modules/filter/filter.filter_html.admin.js index 1a20cfa..fa04df5 100644 --- a/core/modules/filter/filter.filter_html.admin.js +++ b/core/modules/filter/filter.filter_html.admin.js @@ -64,21 +64,21 @@ // The auto-created tag list thus far added. autoTags: null, // Track which new features have been added to the text editor. newFeatures: {}, attach: function (context, settings) { var that = this; $(context).find('[name="filters[filter_html][settings][allowed_html]"]').once('filter-filter_html-updating').each(function () { that.$allowedHTMLFormItem = $(this); - that.$allowedHTMLDescription = that.$allowedHTMLFormItem.closest('.form-item').find('.description'); + that.$allowedHTMLDescription = that.$allowedHTMLFormItem.closest('.js-form-item').find('.description'); that.userTags = that._parseSetting(this.value); // Update the new allowed tags based on added text editor features. $(document) .on('drupalEditorFeatureAdded', function (e, feature) { that.newFeatures[feature.name] = feature.rules; that._updateAllowedTags(); }) .on('drupalEditorFeatureModified', function (e, feature) { if (that.newFeatures.hasOwnProperty(feature.name)) { diff --git a/core/modules/filter/templates/text-format-wrapper.html.twig b/core/modules/filter/templates/text-format-wrapper.html.twig index 367de09..de61d92 100644 --- a/core/modules/filter/templates/text-format-wrapper.html.twig +++ b/core/modules/filter/templates/text-format-wrapper.html.twig @@ -8,16 +8,16 @@ * - description: Text format element description. * - attributes: HTML attributes for the containing element. * - aria_description: Flag for whether or not an ARIA description has been * added to the description container. * * @see template_preprocess_text_format_wrapper() * * @ingroup themeable */ #} -
+
{{ children }} {% if description %} {{ description }}
{% endif %}
diff --git a/core/modules/language/templates/language-negotiation-configure-form.html.twig b/core/modules/language/templates/language-negotiation-configure-form.html.twig index 8bddb46..12528ac 100644 --- a/core/modules/language/templates/language-negotiation-configure-form.html.twig +++ b/core/modules/language/templates/language-negotiation-configure-form.html.twig @@ -16,20 +16,21 @@ * - children: Remaining form items for all groups. * * @see template_preprocess_language_negotiation_configure_form() * * @ingroup themeable */ #} {% for language_type in language_types %} {% set language_classes = [ + 'js-form-item', 'form-item', 'table-language-group', 'table-' ~ language_type.type ~ '-wrapper', ] %}

{{ language_type.title }}

{{ language_type.description }}
{{ language_type.configurable }} {{ language_type.table }} diff --git a/core/modules/locale/locale.admin.js b/core/modules/locale/locale.admin.js index c7bac21..fc4329d 100644 --- a/core/modules/locale/locale.admin.js +++ b/core/modules/locale/locale.admin.js @@ -24,21 +24,21 @@ }); // Highlight changed row. $form.on('formUpdated.localeTranslateDirty', 'tr', function () { var $row = $(this); var $rowToMark = $row.once('localemark'); var marker = Drupal.theme('localeTranslateChangedMarker'); $row.addClass('changed'); // Add an asterisk only once if row changed. if ($rowToMark.length) { - $rowToMark.find('td:first-child .form-item').append(marker); + $rowToMark.find('td:first-child .js-form-item').append(marker); } }); } }, detach: function (context, settings, trigger) { if (trigger === 'unload') { var $form = $("#locale-translate-edit-form").removeOnce('localetranslatedirty'); if ($form.length) { $form.off('formUpdated.localeTranslateDirty'); } diff --git a/core/modules/system/templates/field-multiple-value-form.html.twig b/core/modules/system/templates/field-multiple-value-form.html.twig index f18a853..348621c 100644 --- a/core/modules/system/templates/field-multiple-value-form.html.twig +++ b/core/modules/system/templates/field-multiple-value-form.html.twig @@ -13,21 +13,21 @@ * - table: Table of field items. * - description: Description text for the form element. * - button: "Add another item" button. * * @see template_preprocess_field_multiple_value_form() * * @ingroup themeable */ #} {% if multiple %} -
+
{{ table }} {% if description %}
{{ description }}
{% endif %} {% if button %}
{{ button }}
{% endif %}
{% else %} {% for element in elements %} diff --git a/core/modules/system/templates/fieldset.html.twig b/core/modules/system/templates/fieldset.html.twig index a40e1ab..6170d23 100644 --- a/core/modules/system/templates/fieldset.html.twig +++ b/core/modules/system/templates/fieldset.html.twig @@ -17,20 +17,21 @@ * - prefix: The content to add before the fieldset children. * - suffix: The content to add after the fieldset children. * * @see template_preprocess_fieldset() * * @ingroup themeable */ #} {% set classes = [ + 'js-form-item', 'form-item', 'js-form-wrapper', 'form-wrapper', ] %} {% set legend_span_classes = [ 'fieldset-legend', required ? 'form-required', diff --git a/core/modules/system/templates/form-element.html.twig b/core/modules/system/templates/form-element.html.twig index 9292fd7..2599e34 100644 --- a/core/modules/system/templates/form-element.html.twig +++ b/core/modules/system/templates/form-element.html.twig @@ -41,20 +41,21 @@ * - disabled: True if the element is disabled. * - title_display: Title display setting. * * @see template_preprocess_form_element() * * @ingroup themeable */ #} {% set classes = [ + 'js-form-item', 'form-item', 'js-form-type-' ~ type|clean_class, 'form-item-' ~ name|clean_class, title_display not in ['after', 'before'] ? 'form-no-label', disabled == 'disabled' ? 'form-disabled', errors ? 'form-item--error', ] %} {% set description_classes = [ diff --git a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php index 7adaa16..38c0f2d 100644 --- a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php +++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php @@ -147,21 +147,21 @@ public function buildExtraOptionsForm(&$form, FormStateInterface $form_state) { ':input[name="options[type]"]' => array('value' => 'select'), ), ), ); } protected function valueForm(&$form, FormStateInterface $form_state) { $vocabulary = $this->vocabularyStorage->load($this->options['vid']); if (empty($vocabulary) && $this->options['limit']) { $form['markup'] = array( - '#markup' => '
' . $this->t('An invalid vocabulary is selected. Please change it in the options.') . '
', + '#markup' => '
' . $this->t('An invalid vocabulary is selected. Please change it in the options.') . '
', ); return; } if ($this->options['type'] == 'textfield') { $terms = $this->value ? Term::loadMultiple(($this->value)) : array(); $form['value'] = array( '#title' => $this->options['limit'] ? $this->t('Select terms from vocabulary @voc', array('@voc' => $vocabulary->label())) : $this->t('Select terms'), '#type' => 'textfield', '#default_value' => EntityAutocomplete::getEntityLabels($terms), diff --git a/core/modules/text/text.js b/core/modules/text/text.js index 82fdf2a..7f65615 100644 --- a/core/modules/text/text.js +++ b/core/modules/text/text.js @@ -12,21 +12,21 @@ * * @type {Drupal~behavior} */ Drupal.behaviors.textSummary = { attach: function (context, settings) { $(context).find('.js-text-summary').once('text-summary').each(function () { var $widget = $(this).closest('.js-text-format-wrapper'); var $summary = $widget.find('.js-text-summary-wrapper'); var $summaryLabel = $summary.find('label').eq(0); - var $full = $widget.find('.js-text-full').closest('.form-item'); + var $full = $widget.find('.js-text-full').closest('.js-form-item'); var $fullLabel = $full.find('label').eq(0); // Create a placeholder label when the field cardinality is greater // than 1. if ($fullLabel.length === 0) { $fullLabel = $('').prependTo($full); } // Set up the edit/hide summary link. var $link = $(' ()'); diff --git a/core/modules/views/src/Plugin/views/BrokenHandlerTrait.php b/core/modules/views/src/Plugin/views/BrokenHandlerTrait.php index cdd235e..2f6fab1 100644 --- a/core/modules/views/src/Plugin/views/BrokenHandlerTrait.php +++ b/core/modules/views/src/Plugin/views/BrokenHandlerTrait.php @@ -62,21 +62,21 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { if (is_scalar($value)) { $items[] = SafeMarkup::format('@key: @value', array('@key' => $key, '@value' => $value)); } } $description_bottom = t('Enabling the appropriate module will may solve this issue. Otherwise, check to see if there is a module update available.'); $form['description'] = array( '#type' => 'container', '#attributes' => array( - 'class' => array('form-item', 'description'), + 'class' => array('js-form-item', 'form-item', 'description'), ), 'description_top' => array( '#markup' => '

' . $description_top . '

', ), 'detail_list' => array( '#theme' => 'item_list', '#items' => $items, ), 'description_bottom' => array( '#markup' => '

' . $description_bottom . '

', diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php index f9ae57a..0864bfe 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -1537,21 +1537,21 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#title' => $this->t('Access'), '#title_display' => 'invisible', '#type' => 'radios', '#options' => Views::fetchPluginNames('access', $this->getType(), array($this->view->storage->get('base_table'))), '#default_value' => $access['type'], ); $access_plugin = $this->getPlugin('access'); if ($access_plugin->usesOptions()) { $form['markup'] = array( - '#prefix' => '
', + '#prefix' => '
', '#markup' => $this->t('You may also adjust the !settings for the currently selected access restriction.', array('!settings' => $this->optionLink(t('settings'), 'access_options'))), '#suffix' => '
', ); } break; case 'access_options': $plugin = $this->getPlugin('access'); $form['#title'] .= $this->t('Access options'); if ($plugin) { @@ -1574,21 +1574,21 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#title' => $this->t('Caching'), '#title_display' => 'invisible', '#type' => 'radios', '#options' => Views::fetchPluginNames('cache', $this->getType(), array($this->view->storage->get('base_table'))), '#default_value' => $cache['type'], ); $cache_plugin = $this->getPlugin('cache'); if ($cache_plugin->usesOptions()) { $form['markup'] = array( - '#prefix' => '
', + '#prefix' => '
', '#suffix' => '
', '#markup' => $this->t('You may also adjust the !settings for the currently selected cache mechanism.', array('!settings' => $this->optionLink(t('settings'), 'cache_options'))), ); } break; case 'cache_options': $plugin = $this->getPlugin('cache'); $form['#title'] .= $this->t('Caching options'); if ($plugin) { $form['cache_options'] = array( @@ -1646,21 +1646,21 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#title' => $this->t('Style'), '#title_display' => 'invisible', '#type' => 'radios', '#options' => Views::fetchPluginNames('style', $this->getType(), array($this->view->storage->get('base_table'))), '#default_value' => $style_plugin->definition['id'], '#description' => $this->t('If the style you choose has settings, be sure to click the settings button that will appear next to it in the View summary.'), ); if ($style_plugin->usesOptions()) { $form['markup'] = array( - '#prefix' => '
', + '#prefix' => '
', '#suffix' => '
', '#markup' => $this->t('You may also adjust the !settings for the currently selected style.', array('!settings' => $this->optionLink(t('settings'), 'style_options'))), ); } break; case 'style_options': $form['#title'] .= $this->t('Style options'); $style = TRUE; $style_plugin = $this->getOption('style'); @@ -1694,21 +1694,21 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { $form['row']['type'] = array( '#title' => $this->t('Row'), '#title_display' => 'invisible', '#type' => 'radios', '#options' => Views::fetchPluginNames('row', $this->getType(), array($this->view->storage->get('base_table'))), '#default_value' => $row_plugin_instance->definition['id'], ); if ($row_plugin_instance->usesOptions()) { $form['markup'] = array( - '#prefix' => '
', + '#prefix' => '
', '#suffix' => '
', '#markup' => $this->t('You may also adjust the !settings for the currently selected row style.', array('!settings' => $this->optionLink(t('settings'), 'row_options'))), ); } break; case 'link_display': $form['#title'] .= $this->t('Which display to use for path'); $options = array(FALSE => $this->t('None'), 'custom_url' => $this->t('Custom URL')); @@ -1761,21 +1761,21 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#states' => array( 'visible' => array( ':input[name="link_display"]' => array('value' => 'custom_url'), ), ), ); break; case 'exposed_block': $form['#title'] .= $this->t('Put the exposed form in a block'); $form['description'] = array( - '#markup' => '
' . $this->t('If set, any exposed widgets will not appear with this view. Instead, a block will be made available to the Drupal block administration system, and the exposed form will appear there. Note that this block must be enabled manually, Views will not enable it for you.') . '
', + '#markup' => '
' . $this->t('If set, any exposed widgets will not appear with this view. Instead, a block will be made available to the Drupal block administration system, and the exposed form will appear there. Note that this block must be enabled manually, Views will not enable it for you.') . '
', ); $form['exposed_block'] = array( '#type' => 'radios', '#options' => array(1 => $this->t('Yes'), 0 => $this->t('No')), '#default_value' => $this->getOption('exposed_block') ? 1 : 0, ); break; case 'exposed_form': $form['#title'] .= $this->t('Exposed Form'); $form['exposed_form'] = array( @@ -1789,21 +1789,21 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#title' => $this->t('Exposed form'), '#title_display' => 'invisible', '#type' => 'radios', '#options' => Views::fetchPluginNames('exposed_form', $this->getType(), array($this->view->storage->get('base_table'))), '#default_value' => $exposed_form['type'], ); $exposed_form_plugin = $this->getPlugin('exposed_form'); if ($exposed_form_plugin->usesOptions()) { $form['markup'] = array( - '#prefix' => '
', + '#prefix' => '
', '#suffix' => '
', '#markup' => $this->t('You may also adjust the !settings for the currently selected style.', array('!settings' => $this->optionLink(t('settings'), 'exposed_form_options'))), ); } break; case 'exposed_form_options': $plugin = $this->getPlugin('exposed_form'); $form['#title'] .= $this->t('Exposed form options'); if ($plugin) { $form['exposed_form_options'] = array( @@ -1825,21 +1825,21 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#title' => $this->t('Pager'), '#title_display' => 'invisible', '#type' => 'radios', '#options' => Views::fetchPluginNames('pager', !$this->usesPager() ? 'basic' : NULL, array($this->view->storage->get('base_table'))), '#default_value' => $pager['type'], ); $pager_plugin = $this->getPlugin('pager'); if ($pager_plugin->usesOptions()) { $form['markup'] = array( - '#prefix' => '
', + '#prefix' => '
', '#suffix' => '
', '#markup' => $this->t('You may also adjust the !settings for the currently selected pager.', array('!settings' => $this->optionLink(t('settings'), 'pager_options'))), ); } break; case 'pager_options': $plugin = $this->getPlugin('pager'); $form['#title'] .= $this->t('Pager options'); if ($plugin) { diff --git a/core/modules/views/src/Plugin/views/display/Page.php b/core/modules/views/src/Plugin/views/display/Page.php index 7ec3560..85ccb4c 100644 --- a/core/modules/views/src/Plugin/views/display/Page.php +++ b/core/modules/views/src/Plugin/views/display/Page.php @@ -361,21 +361,21 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { ); break; case 'tab_options': $form['#title'] .= $this->t('Default tab options'); $tab_options = $this->getOption('tab_options'); if (empty($tab_options)) { $tab_options = array('type' => 'none', 'title' => '', 'weight' => 0); } $form['tab_markup'] = array( - '#markup' => '
' . $this->t('When providing a menu item as a tab, Drupal needs to know what the parent menu item of that tab will be. Sometimes the parent will already exist, but other times you will need to have one created. The path of a parent item will always be the same path with the last part left off. i.e, if the path to this view is foo/bar/baz, the parent path would be foo/bar.') . '
', + '#markup' => '
' . $this->t('When providing a menu item as a tab, Drupal needs to know what the parent menu item of that tab will be. Sometimes the parent will already exist, but other times you will need to have one created. The path of a parent item will always be the same path with the last part left off. i.e, if the path to this view is foo/bar/baz, the parent path would be foo/bar.') . '
', ); $form['tab_options'] = array( '#prefix' => '
', '#suffix' => '
', '#tree' => TRUE, ); $form['tab_options']['type'] = array( '#prefix' => '
', '#suffix' => '
', diff --git a/core/modules/views/src/Plugin/views/style/Table.php b/core/modules/views/src/Plugin/views/style/Table.php index 8a594cf..65e2251 100644 --- a/core/modules/views/src/Plugin/views/style/Table.php +++ b/core/modules/views/src/Plugin/views/style/Table.php @@ -406,21 +406,21 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { ); $form['empty_table'] = array( '#type' => 'checkbox', '#title' => $this->t('Show the empty text in the table'), '#default_value' => $this->options['empty_table'], '#description' => $this->t('Per default the table is hidden for an empty view. With this option it is possible to show an empty table with the text in it.'), ); $form['description_markup'] = array( - '#markup' => '
' . $this->t('Place fields into columns; you may combine multiple fields into the same column. If you do, the separator in the column specified will be used to separate the fields. Check the sortable box to make that column click sortable, and check the default sort radio to determine which column will be sorted by default, if any. You may control column order and field labels in the fields section.') . '
', + '#markup' => '
' . $this->t('Place fields into columns; you may combine multiple fields into the same column. If you do, the separator in the column specified will be used to separate the fields. Check the sortable box to make that column click sortable, and check the default sort radio to determine which column will be sorted by default, if any. You may control column order and field labels in the fields section.') . '
', ); } public function evenEmpty() { return parent::evenEmpty() || !empty($this->options['empty_table']); } public function wizardSubmit(&$form, FormStateInterface $form_state, WizardInterface $wizard, &$display_options, $display_type) { // If any of the displays use the table style, make sure that the fields // always have a labels by unsetting the override. diff --git a/core/modules/views_ui/src/Form/Ajax/AddHandler.php b/core/modules/views_ui/src/Form/Ajax/AddHandler.php index a60da37..eef8f7d 100644 --- a/core/modules/views_ui/src/Form/Ajax/AddHandler.php +++ b/core/modules/views_ui/src/Form/Ajax/AddHandler.php @@ -155,21 +155,21 @@ public function buildForm(array $form, FormStateInterface $form_state) { ) ) ); } } $form['override']['controls']['group']['#options'] = $groups; } else { $form['options']['markup'] = array( - '#markup' => '
' . $this->t('There are no @types available to add.', array('@types' => $ltitle)) . '
', + '#markup' => '
' . $this->t('There are no @types available to add.', array('@types' => $ltitle)) . '
', ); } // Add a div to show the selected items $form['selected'] = array( '#type' => 'item', '#markup' => '' . $this->t('Selected:') . ' ' . '
', '#theme_wrappers' => array('form_element', 'views_ui_container'), '#attributes' => array( 'class' => array('container-inline', 'views-add-form-selected', 'views-offset-bottom'), 'data-drupal-views-offset' => 'bottom', diff --git a/core/modules/views_ui/src/Form/Ajax/Analyze.php b/core/modules/views_ui/src/Form/Ajax/Analyze.php index 95e126a..b53800d 100644 --- a/core/modules/views_ui/src/Form/Ajax/Analyze.php +++ b/core/modules/views_ui/src/Form/Ajax/Analyze.php @@ -37,21 +37,21 @@ public function getFormId() { public function buildForm(array $form, FormStateInterface $form_state) { $view = $form_state->get('view'); $form['#title'] = $this->t('View analysis'); $form['#section'] = 'analyze'; $analyzer = Views::analyzer(); $messages = $analyzer->getMessages($view->getExecutable()); $form['analysis'] = array( - '#prefix' => '
', + '#prefix' => '
', '#suffix' => '
', '#markup' => $analyzer->formatMessages($messages), ); // Inform the standard button function that we want an OK button. $form_state->set('ok_button', TRUE); $view->getStandardButtons($form, $form_state, 'views_ui_analyze_view_form'); return $form; } diff --git a/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php b/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php index e290789..8df344a 100644 --- a/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php +++ b/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php @@ -153,21 +153,21 @@ public function buildForm(array $form, FormStateInterface $form_state, Request $ '#value' => 'none', ); } $form['#title'] = $this->t('Configure @type: @item', array('@type' => $types[$type]['lstitle'], '@item' => $handler->adminLabel())); if (!empty($handler->definition['help'])) { $form['options']['form_description'] = array( '#markup' => $handler->definition['help'], '#theme_wrappers' => array('container'), - '#attributes' => array('class' => array('form-item description')), + '#attributes' => array('class' => array('js-form-item form-item description')), '#weight' => -1000, ); } $form['#section'] = $display_id . '-' . $type . '-' . $id; // Get form from the handler. $handler->buildOptionsForm($form['options'], $form_state); $form_state->set('handler', $handler); } diff --git a/core/themes/classy/templates/content-edit/text-format-wrapper.html.twig b/core/themes/classy/templates/content-edit/text-format-wrapper.html.twig index 4bd1566..08a88ca 100644 --- a/core/themes/classy/templates/content-edit/text-format-wrapper.html.twig +++ b/core/themes/classy/templates/content-edit/text-format-wrapper.html.twig @@ -6,21 +6,21 @@ * Available variables: * - children: Text format element children. * - description: Text format element description. * - attributes: HTML attributes for the containing element. * - aria_description: Flag for whether or not an ARIA description has been * added to the description container. * * @see template_preprocess_text_format_wrapper() */ #} -
+
{{ children }} {% if description %} {% set classes = [ aria_description ? 'description', ] %} {{ description }}
{% endif %}
diff --git a/core/themes/classy/templates/form/field-multiple-value-form.html.twig b/core/themes/classy/templates/form/field-multiple-value-form.html.twig index 1eac971..bcc7b89 100644 --- a/core/themes/classy/templates/form/field-multiple-value-form.html.twig +++ b/core/themes/classy/templates/form/field-multiple-value-form.html.twig @@ -11,21 +11,21 @@ * * Available variables when there are multiple fields. * - table: Table of field items. * - description: Description text for the form element. * - button: "Add another item" button. * * @see template_preprocess_field_multiple_value_form() */ #} {% if multiple %} -
+
{{ table }} {% if description %}
{{ description }}
{% endif %} {% if button %}
{{ button }}
{% endif %}
{% else %} {% for element in elements %} diff --git a/core/themes/classy/templates/form/fieldset.html.twig b/core/themes/classy/templates/form/fieldset.html.twig index 5e0d795..ce8742d 100644 --- a/core/themes/classy/templates/form/fieldset.html.twig +++ b/core/themes/classy/templates/form/fieldset.html.twig @@ -15,20 +15,21 @@ * - attributes: HTML attributes to apply to the description container. * - children: The rendered child elements of the fieldset. * - prefix: The content to add before the fieldset children. * - suffix: The content to add after the fieldset children. * * @see template_preprocess_fieldset() */ #} {% set classes = [ + 'js-form-item', 'form-item', 'js-form-wrapper', 'form-wrapper', ] %} {% set legend_span_classes = [ 'fieldset-legend', required ? 'form-required', diff --git a/core/themes/classy/templates/form/form-element.html.twig b/core/themes/classy/templates/form/form-element.html.twig index 65028fa..7e28b64 100644 --- a/core/themes/classy/templates/form/form-element.html.twig +++ b/core/themes/classy/templates/form/form-element.html.twig @@ -39,20 +39,21 @@ * - invisible: The description is output after the element, hidden visually * but available to screen readers. * - disabled: True if the element is disabled. * - title_display: Title display setting. * * @see template_preprocess_form_element() */ #} {% set classes = [ + 'js-form-item', 'form-item', 'js-form-type-' ~ type|clean_class, 'form-type-' ~ type|clean_class, 'form-item-' ~ name|clean_class, title_display not in ['after', 'before'] ? 'form-no-label', disabled == 'disabled' ? 'form-disabled', errors ? 'form-item--error', ] %} {%