Commit d4bef057 authored by alexpott's avatar alexpott

Issue #2473957 by sqndr, Cottser, LewisNyman: Prefix text-* classes with js-

parent f213f859
......@@ -78,7 +78,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
'#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;
......
......@@ -79,7 +79,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
'#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;
......
......@@ -15,7 +15,7 @@
* @ingroup themeable
*/
#}
<div>
<div class="js-text-format-wrapper">
{{ children }}
{% if description %}
<div{{ attributes }}>{{ description }}</div>
......
......@@ -78,8 +78,8 @@ function formElement(FieldItemListInterface $items, $delta, array $element, arra
'#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,
);
......
......@@ -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');
}
});
......
......@@ -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 %}
{%
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment