Commit 08bd73b6 authored by webchick's avatar webchick

Issue #2329789 by lauriii: Move toolbar classes from preprocess to templates.

parent f92c2cb4
......@@ -22,11 +22,11 @@
* @ingroup themeable
*/
#}
<div{{ attributes }}>
<nav{{ toolbar_attributes }}>
<div{{ attributes.addClass('toolbar') }}>
<nav{{ toolbar_attributes.addClass('toolbar-bar', 'clearfix') }}>
<h2 class="visually-hidden">{{ toolbar_heading }}</h2>
{% for tab in tabs %}
<div{{ tab.attributes }}>{{ tab.link }}</div>
<div{{ tab.attributes.addClass('toolbar-tab') }}>{{ tab.link }}</div>
{% endfor %}
</nav>
{% for tray in trays %}
......
......@@ -78,7 +78,6 @@ function toolbar_element_info() {
// The id cannot be simply "toolbar" or it will clash with the simpletest
// tests listing which produces a checkbox with attribute id="toolbar"
'id' => 'toolbar-administration',
'class' => array('toolbar'),
'role' => 'group',
'aria-label' => t('Site administration toolbar'),
),
......@@ -87,7 +86,6 @@ function toolbar_element_info() {
'#heading' => t('Toolbar items'),
'#attributes' => array(
'id' => 'toolbar-bar',
'class' => array('toolbar-bar', 'clearfix',),
'role' => 'navigation',
'aria-label' => t('Toolbar items'),
),
......@@ -243,14 +241,11 @@ function template_preprocess_toolbar(&$variables) {
}
}
$attributes = array();
// Pass the wrapper attributes along.
if (array_key_exists('#wrapper_attributes', $element[$key])) {
$element[$key]['#wrapper_attributes']['class'][] = 'toolbar-tab';
$attributes = $element[$key]['#wrapper_attributes'];
}
else {
$attributes = array('class' => array('toolbar-tab'));
}
// Add the tab.
$variables['tabs'][$key] = array(
......
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