summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2015-05-10 17:32:22 -0700
committerAlex Pott2015-05-10 17:32:22 -0700
commitd4bef0575209a68900ee0dacfb91277cf9942239 (patch)
treed6e8b421324a93e434829590883461d4cfa5104b
parentf213f8597208273d89680fa851429e7c8d1e340e (diff)
Issue #2473957 by sqndr, Cottser, LewisNyman: Prefix text-* classes with js-
-rw-r--r--core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php2
-rw-r--r--core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextfieldWidget.php2
-rw-r--r--core/modules/filter/templates/text-format-wrapper.html.twig2
-rw-r--r--core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php4
-rw-r--r--core/modules/text/text.js10
-rw-r--r--core/themes/classy/templates/content-edit/text-format-wrapper.html.twig2
6 files changed, 11 insertions, 11 deletions
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php
index 8658dd0..44af9df 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php
@@ -78,7 +78,7 @@ class StringTextareaWidget extends WidgetBase {
'#default_value' => $items[$delta]->value,
'#rows' => $this->getSetting('rows'),
'#placeholder' => $this->getSetting('placeholder'),
- '#attributes' => array('class' => array('text-full')),
+ '#attributes' => array('class' => array('js-text-full', 'text-full')),
);
return $element;
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextfieldWidget.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextfieldWidget.php
index 0ed4239..79bc044 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextfieldWidget.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextfieldWidget.php
@@ -79,7 +79,7 @@ class StringTextfieldWidget extends WidgetBase {
'#size' => $this->getSetting('size'),
'#placeholder' => $this->getSetting('placeholder'),
'#maxlength' => $this->getFieldSetting('max_length'),
- '#attributes' => array('class' => array('text-full')),
+ '#attributes' => array('class' => array('js-text-full', 'text-full')),
);
return $element;
diff --git a/core/modules/filter/templates/text-format-wrapper.html.twig b/core/modules/filter/templates/text-format-wrapper.html.twig
index ce3ba55..367de09 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>
+<div class="js-text-format-wrapper">
{{ children }}
{% if description %}
<div{{ attributes }}>{{ description }}</div>
diff --git a/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php b/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php
index ba8c875..c6bef4f 100644
--- a/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php
+++ b/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php
@@ -78,8 +78,8 @@ class TextareaWithSummaryWidget extends TextareaWidget {
'#attached' => array(
'library' => array('text/drupal.text'),
),
- '#attributes' => array('class' => array('text-summary')),
- '#prefix' => '<div class="text-summary-wrapper">',
+ '#attributes' => array('class' => array('js-text-summary', 'text-summary')),
+ '#prefix' => '<div class="js-text-summary-wrapper text-summary-wrapper">',
'#suffix' => '</div>',
'#weight' => -10,
);
diff --git a/core/modules/text/text.js b/core/modules/text/text.js
index 2ab1d0a..7360e44 100644
--- a/core/modules/text/text.js
+++ b/core/modules/text/text.js
@@ -7,12 +7,12 @@
*/
Drupal.behaviors.textSummary = {
attach: function (context, settings) {
- $(context).find('.text-summary').once('text-summary').each(function () {
- var $widget = $(this).closest('.text-format-wrapper');
+ $(context).find('.js-text-summary').once('text-summary').each(function () {
+ var $widget = $(this).closest('.js-text-format-wrapper');
- var $summary = $widget.find('.text-summary-wrapper');
+ var $summary = $widget.find('.js-text-summary-wrapper');
var $summaryLabel = $summary.find('label').eq(0);
- var $full = $widget.find('.text-full').closest('.form-item');
+ var $full = $widget.find('.js-text-full').closest('.form-item');
var $fullLabel = $full.find('label').eq(0);
// Create a placeholder label when the field cardinality is greater
@@ -41,7 +41,7 @@
}).appendTo($summaryLabel);
// If no summary is set, hide the summary field.
- if ($widget.find('.text-summary').val() === '') {
+ if ($widget.find('.js-text-summary').val() === '') {
$link.trigger('click');
}
});
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 b8e0250..4bd1566 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="text-format-wrapper form-item">
+<div class="js-text-format-wrapper text-format-wrapper form-item">
{{ children }}
{% if description %}
{%