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
08bd73b6
Commit
08bd73b6
authored
Sep 08, 2014
by
webchick
Browse files
Issue
#2329789
by lauriii: Move toolbar classes from preprocess to templates.
parent
f92c2cb4
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/modules/toolbar/templates/toolbar.html.twig
View file @
08bd73b6
...
@@ -22,11 +22,11 @@
...
@@ -22,11 +22,11 @@
* @ingroup themeable
* @ingroup themeable
*/
*/
#}
#}
<div
{{
attributes
}}
>
<div
{{
attributes
.addClass
(
'toolbar'
)
}}
>
<nav
{{
toolbar_attributes
}}
>
<nav
{{
toolbar_attributes
.addClass
(
'toolbar-bar'
,
'clearfix'
)
}}
>
<h2
class=
"visually-hidden"
>
{{
toolbar_heading
}}
</h2>
<h2
class=
"visually-hidden"
>
{{
toolbar_heading
}}
</h2>
{%
for
tab
in
tabs
%}
{%
for
tab
in
tabs
%}
<div
{{
tab.attributes
}}
>
{{
tab.link
}}
</div>
<div
{{
tab.attributes
.addClass
(
'toolbar-tab'
)
}}
>
{{
tab.link
}}
</div>
{%
endfor
%}
{%
endfor
%}
</nav>
</nav>
{%
for
tray
in
trays
%}
{%
for
tray
in
trays
%}
...
...
core/modules/toolbar/toolbar.module
View file @
08bd73b6
...
@@ -78,7 +78,6 @@ function toolbar_element_info() {
...
@@ -78,7 +78,6 @@ function toolbar_element_info() {
// The id cannot be simply "toolbar" or it will clash with the simpletest
// The id cannot be simply "toolbar" or it will clash with the simpletest
// tests listing which produces a checkbox with attribute id="toolbar"
// tests listing which produces a checkbox with attribute id="toolbar"
'id'
=>
'toolbar-administration'
,
'id'
=>
'toolbar-administration'
,
'class'
=>
array
(
'toolbar'
),
'role'
=>
'group'
,
'role'
=>
'group'
,
'aria-label'
=>
t
(
'Site administration toolbar'
),
'aria-label'
=>
t
(
'Site administration toolbar'
),
),
),
...
@@ -87,7 +86,6 @@ function toolbar_element_info() {
...
@@ -87,7 +86,6 @@ function toolbar_element_info() {
'#heading'
=>
t
(
'Toolbar items'
),
'#heading'
=>
t
(
'Toolbar items'
),
'#attributes'
=>
array
(
'#attributes'
=>
array
(
'id'
=>
'toolbar-bar'
,
'id'
=>
'toolbar-bar'
,
'class'
=>
array
(
'toolbar-bar'
,
'clearfix'
,),
'role'
=>
'navigation'
,
'role'
=>
'navigation'
,
'aria-label'
=>
t
(
'Toolbar items'
),
'aria-label'
=>
t
(
'Toolbar items'
),
),
),
...
@@ -243,14 +241,11 @@ function template_preprocess_toolbar(&$variables) {
...
@@ -243,14 +241,11 @@ function template_preprocess_toolbar(&$variables) {
}
}
}
}
$attributes
=
array
();
// Pass the wrapper attributes along.
// Pass the wrapper attributes along.
if
(
array_key_exists
(
'#wrapper_attributes'
,
$element
[
$key
]))
{
if
(
array_key_exists
(
'#wrapper_attributes'
,
$element
[
$key
]))
{
$element
[
$key
][
'#wrapper_attributes'
][
'class'
][]
=
'toolbar-tab'
;
$attributes
=
$element
[
$key
][
'#wrapper_attributes'
];
$attributes
=
$element
[
$key
][
'#wrapper_attributes'
];
}
}
else
{
$attributes
=
array
(
'class'
=>
array
(
'toolbar-tab'
));
}
// Add the tab.
// Add the tab.
$variables
[
'tabs'
][
$key
]
=
array
(
$variables
[
'tabs'
][
$key
]
=
array
(
...
...
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