Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
d4bef057
Commit
d4bef057
authored
May 10, 2015
by
alexpott
Browse files
Issue
#2473957
by sqndr, Cottser, LewisNyman: Prefix text-* classes with js-
parent
f213f859
Changes
6
Hide whitespace changes
Inline
Side-by-side
core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php
View file @
d4bef057
...
...
@@ -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
;
...
...
core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextfieldWidget.php
View file @
d4bef057
...
...
@@ -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
;
...
...
core/modules/filter/templates/text-format-wrapper.html.twig
View file @
d4bef057
...
...
@@ -15,7 +15,7 @@
* @ingroup themeable
*/
#}
<div>
<div
class=
"js-text-format-wrapper"
>
{{
children
}}
{%
if
description
%}
<div
{{
attributes
}}
>
{{
description
}}
</div>
...
...
core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php
View file @
d4bef057
...
...
@@ -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
,
);
...
...
core/modules/text/text.js
View file @
d4bef057
...
...
@@ -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
'
);
}
});
...
...
core/themes/classy/templates/content-edit/text-format-wrapper.html.twig
View file @
d4bef057
...
...
@@ -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
%}
{%
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment