summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2015-09-09 15:00:24 (GMT)
committerAlex Pott2015-09-09 15:00:24 (GMT)
commit44e0f2f9261d70f486fc030e2568f5b205bee11b (patch)
tree704d52e526543eae2e3a96be53c7f69405340e21
parentdb342cbdb3c9c16952ff91d7deca14792a968909 (diff)
Issue #2473945 by Cottser, rachel_norfolk, axe312, davidhernandez, yannickoo, emma.maria, cilefen, akalata, jaxxed, LewisNyman: Prefix form-item classes with js-
-rw-r--r--core/misc/machine-name.js2
-rw-r--r--core/misc/states.js8
-rw-r--r--core/modules/filter/filter.filter_html.admin.js2
-rw-r--r--core/modules/filter/templates/text-format-wrapper.html.twig2
-rw-r--r--core/modules/language/templates/language-negotiation-configure-form.html.twig1
-rw-r--r--core/modules/locale/locale.admin.js2
-rw-r--r--core/modules/system/templates/field-multiple-value-form.html.twig2
-rw-r--r--core/modules/system/templates/fieldset.html.twig1
-rw-r--r--core/modules/system/templates/form-element.html.twig1
-rw-r--r--core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php2
-rw-r--r--core/modules/text/text.js2
-rw-r--r--core/modules/views/src/Plugin/views/BrokenHandlerTrait.php2
-rw-r--r--core/modules/views/src/Plugin/views/display/DisplayPluginBase.php14
-rw-r--r--core/modules/views/src/Plugin/views/display/Page.php2
-rw-r--r--core/modules/views/src/Plugin/views/style/Table.php2
-rw-r--r--core/modules/views_ui/src/Form/Ajax/AddHandler.php2
-rw-r--r--core/modules/views_ui/src/Form/Ajax/Analyze.php2
-rw-r--r--core/modules/views_ui/src/Form/Ajax/ConfigHandler.php2
-rw-r--r--core/themes/classy/templates/content-edit/text-format-wrapper.html.twig2
-rw-r--r--core/themes/classy/templates/form/field-multiple-value-form.html.twig2
-rw-r--r--core/themes/classy/templates/form/fieldset.html.twig1
-rw-r--r--core/themes/classy/templates/form/form-element.html.twig1
22 files changed, 31 insertions, 26 deletions
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
@@ -92,7 +92,7 @@
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;
diff --git a/core/misc/states.js b/core/misc/states.js
index c10e306..c87bf58 100644
--- a/core/misc/states.js
+++ b/core/misc/states.js
@@ -596,7 +596,7 @@
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.
@@ -607,21 +607,21 @@
$(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('js-form-required').length) {
$label.addClass('js-form-required form-required');
}
}
else {
- $(e.target).removeAttr('required aria-required').closest('.form-item, .js-form-wrapper').find('label.js-form-required').removeClass('js-form-required form-required');
+ $(e.target).removeAttr('required aria-required').closest('.js-form-item, .js-form-wrapper').find('label.js-form-required').removeClass('js-form-required 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);
}
});
diff --git a/core/modules/filter/filter.filter_html.admin.js b/core/modules/filter/filter.filter_html.admin.js
index 75a9824..a52edd1 100644
--- a/core/modules/filter/filter.filter_html.admin.js
+++ b/core/modules/filter/filter.filter_html.admin.js
@@ -76,7 +76,7 @@
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.
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
@@ -15,7 +15,7 @@
* @ingroup themeable
*/
#}
-<div class="js-text-format-wrapper">
+<div class="js-text-format-wrapper js-form-item form-item">
{{ children }}
{% if description %}
<div{{ attributes }}>{{ description }}</div>
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
@@ -23,6 +23,7 @@
{% for language_type in language_types %}
{%
set language_classes = [
+ 'js-form-item',
'form-item',
'table-language-group',
'table-' ~ language_type.type ~ '-wrapper',
diff --git a/core/modules/locale/locale.admin.js b/core/modules/locale/locale.admin.js
index 6bfe594..be54349 100644
--- a/core/modules/locale/locale.admin.js
+++ b/core/modules/locale/locale.admin.js
@@ -36,7 +36,7 @@
$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);
}
});
}
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
@@ -20,7 +20,7 @@
*/
#}
{% if multiple %}
- <div class="form-item">
+ <div class="js-form-item form-item">
{{ table }}
{% if description %}
<div class="description">{{ description }}</div>
diff --git a/core/modules/system/templates/fieldset.html.twig b/core/modules/system/templates/fieldset.html.twig
index d8372a7..b67ec85 100644
--- a/core/modules/system/templates/fieldset.html.twig
+++ b/core/modules/system/templates/fieldset.html.twig
@@ -24,6 +24,7 @@
#}
{%
set classes = [
+ 'js-form-item',
'form-item',
'js-form-wrapper',
'form-wrapper',
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
@@ -48,6 +48,7 @@
#}
{%
set classes = [
+ 'js-form-item',
'form-item',
'js-form-type-' ~ type|clean_class,
'form-item-' ~ name|clean_class,
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
@@ -154,7 +154,7 @@ class TaxonomyIndexTid extends ManyToOne {
$vocabulary = $this->vocabularyStorage->load($this->options['vid']);
if (empty($vocabulary) && $this->options['limit']) {
$form['markup'] = array(
- '#markup' => '<div class="form-item">' . $this->t('An invalid vocabulary is selected. Please change it in the options.') . '</div>',
+ '#markup' => '<div class="js-form-item form-item">' . $this->t('An invalid vocabulary is selected. Please change it in the options.') . '</div>',
);
return;
}
diff --git a/core/modules/text/text.js b/core/modules/text/text.js
index 382b6f2..54da56c 100644
--- a/core/modules/text/text.js
+++ b/core/modules/text/text.js
@@ -22,7 +22,7 @@
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
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
@@ -69,7 +69,7 @@ trait BrokenHandlerTrait {
$form['description'] = array(
'#type' => 'container',
'#attributes' => array(
- 'class' => array('form-item', 'description'),
+ 'class' => array('js-form-item', 'form-item', 'description'),
),
'description_top' => array(
'#markup' => '<p>' . $description_top . '</p>',
diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
index a049afc..09fa129 100644
--- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
+++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
@@ -1543,7 +1543,7 @@ abstract class DisplayPluginBase extends PluginBase implements DisplayPluginInte
$access_plugin = $this->getPlugin('access');
if ($access_plugin->usesOptions()) {
$form['markup'] = array(
- '#prefix' => '<div class="form-item description">',
+ '#prefix' => '<div class="js-form-item form-item description">',
'#markup' => $this->t('You may also adjust the !settings for the currently selected access restriction.', array('!settings' => $this->optionLink(t('settings'), 'access_options'))),
'#suffix' => '</div>',
);
@@ -1580,7 +1580,7 @@ abstract class DisplayPluginBase extends PluginBase implements DisplayPluginInte
$cache_plugin = $this->getPlugin('cache');
if ($cache_plugin->usesOptions()) {
$form['markup'] = array(
- '#prefix' => '<div class="form-item description">',
+ '#prefix' => '<div class="js-form-item form-item description">',
'#suffix' => '</div>',
'#markup' => $this->t('You may also adjust the !settings for the currently selected cache mechanism.', array('!settings' => $this->optionLink(t('settings'), 'cache_options'))),
);
@@ -1652,7 +1652,7 @@ abstract class DisplayPluginBase extends PluginBase implements DisplayPluginInte
if ($style_plugin->usesOptions()) {
$form['markup'] = array(
- '#prefix' => '<div class="form-item description">',
+ '#prefix' => '<div class="js-form-item form-item description">',
'#suffix' => '</div>',
'#markup' => $this->t('You may also adjust the !settings for the currently selected style.', array('!settings' => $this->optionLink(t('settings'), 'style_options'))),
);
@@ -1700,7 +1700,7 @@ abstract class DisplayPluginBase extends PluginBase implements DisplayPluginInte
if ($row_plugin_instance->usesOptions()) {
$form['markup'] = array(
- '#prefix' => '<div class="form-item description">',
+ '#prefix' => '<div class="js-form-item form-item description">',
'#suffix' => '</div>',
'#markup' => $this->t('You may also adjust the !settings for the currently selected row style.', array('!settings' => $this->optionLink(t('settings'), 'row_options'))),
);
@@ -1767,7 +1767,7 @@ abstract class DisplayPluginBase extends PluginBase implements DisplayPluginInte
case 'exposed_block':
$form['#title'] .= $this->t('Put the exposed form in a block');
$form['description'] = array(
- '#markup' => '<div class="description form-item">' . $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.') . '</div>',
+ '#markup' => '<div class="js-form-item form-item description">' . $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.') . '</div>',
);
$form['exposed_block'] = array(
'#type' => 'radios',
@@ -1795,7 +1795,7 @@ abstract class DisplayPluginBase extends PluginBase implements DisplayPluginInte
$exposed_form_plugin = $this->getPlugin('exposed_form');
if ($exposed_form_plugin->usesOptions()) {
$form['markup'] = array(
- '#prefix' => '<div class="form-item description">',
+ '#prefix' => '<div class="js-form-item form-item description">',
'#suffix' => '</div>',
'#markup' => $this->t('You may also adjust the !settings for the currently selected style.', array('!settings' => $this->optionLink(t('settings'), 'exposed_form_options'))),
);
@@ -1831,7 +1831,7 @@ abstract class DisplayPluginBase extends PluginBase implements DisplayPluginInte
$pager_plugin = $this->getPlugin('pager');
if ($pager_plugin->usesOptions()) {
$form['markup'] = array(
- '#prefix' => '<div class="form-item description">',
+ '#prefix' => '<div class="js-form-item form-item description">',
'#suffix' => '</div>',
'#markup' => $this->t('You may also adjust the !settings for the currently selected pager.', array('!settings' => $this->optionLink(t('settings'), 'pager_options'))),
);
diff --git a/core/modules/views/src/Plugin/views/display/Page.php b/core/modules/views/src/Plugin/views/display/Page.php
index 8868c8b..656105c 100644
--- a/core/modules/views/src/Plugin/views/display/Page.php
+++ b/core/modules/views/src/Plugin/views/display/Page.php
@@ -366,7 +366,7 @@ class Page extends PathPluginBase {
}
$form['tab_markup'] = array(
- '#markup' => '<div class="form-item description">' . $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 <em>foo/bar/baz</em>, the parent path would be <em>foo/bar</em>.') . '</div>',
+ '#markup' => '<div class="js-form-item form-item description">' . $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 <em>foo/bar/baz</em>, the parent path would be <em>foo/bar</em>.') . '</div>',
);
$form['tab_options'] = array(
diff --git a/core/modules/views/src/Plugin/views/style/Table.php b/core/modules/views/src/Plugin/views/style/Table.php
index 1993838..6e4e158 100644
--- a/core/modules/views/src/Plugin/views/style/Table.php
+++ b/core/modules/views/src/Plugin/views/style/Table.php
@@ -413,7 +413,7 @@ class Table extends StylePluginBase implements CacheablePluginInterface {
);
$form['description_markup'] = array(
- '#markup' => '<div class="description form-item">' . $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.') . '</div>',
+ '#markup' => '<div class="js-form-item form-item description">' . $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.') . '</div>',
);
}
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
@@ -162,7 +162,7 @@ class AddHandler extends ViewsFormBase {
}
else {
$form['options']['markup'] = array(
- '#markup' => '<div class="form-item">' . $this->t('There are no @types available to add.', array('@types' => $ltitle)) . '</div>',
+ '#markup' => '<div class="js-form-item form-item">' . $this->t('There are no @types available to add.', array('@types' => $ltitle)) . '</div>',
);
}
// Add a div to show the selected items
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
@@ -44,7 +44,7 @@ class Analyze extends ViewsFormBase {
$messages = $analyzer->getMessages($view->getExecutable());
$form['analysis'] = array(
- '#prefix' => '<div class="form-item">',
+ '#prefix' => '<div class="js-form-item form-item">',
'#suffix' => '</div>',
'#markup' => $analyzer->formatMessages($messages),
);
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
@@ -160,7 +160,7 @@ class ConfigHandler extends ViewsFormBase {
$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,
);
}
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
@@ -13,7 +13,7 @@
* @see template_preprocess_text_format_wrapper()
*/
#}
-<div class="js-text-format-wrapper text-format-wrapper form-item">
+<div class="js-text-format-wrapper text-format-wrapper js-form-item form-item">
{{ children }}
{% if description %}
{%
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
@@ -18,7 +18,7 @@
*/
#}
{% if multiple %}
- <div class="form-item">
+ <div class="js-form-item form-item">
{{ table }}
{% if description %}
<div class="description">{{ description }}</div>
diff --git a/core/themes/classy/templates/form/fieldset.html.twig b/core/themes/classy/templates/form/fieldset.html.twig
index e507d4c..4bd7d0a 100644
--- a/core/themes/classy/templates/form/fieldset.html.twig
+++ b/core/themes/classy/templates/form/fieldset.html.twig
@@ -22,6 +22,7 @@
#}
{%
set classes = [
+ 'js-form-item',
'form-item',
'js-form-wrapper',
'form-wrapper',
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
@@ -46,6 +46,7 @@
#}
{%
set classes = [
+ 'js-form-item',
'form-item',
'js-form-type-' ~ type|clean_class,
'form-type-' ~ type|clean_class,