Skip to content
Snippets Groups Projects
Commit be6f421c authored by Angie Byron's avatar Angie Byron
Browse files

Issue #1849610 by mgifford, edrupal, dawehner, rootwork, falcon03: Improve...

Issue #1849610 by mgifford, edrupal, dawehner, rootwork, falcon03: Improve 'add' links accessibility.
parent 4d02ee3c
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -919,17 +919,24 @@ public function getFormBucket(ViewUI $view, $type, $display) {
// Create an array of actions to pass to theme_links
$actions = array();
$count_handlers = count($executable->display_handler->getHandlers($type));
// Create the add text variable for the add action.
$add_text = t('Add <span class="element-invisible">@type</span>', array('@type' => $types[$type]['ltitle']));
$actions['add'] = array(
'title' => t('Add'),
'title' => $add_text,
'href' => "admin/structure/views/nojs/add-item/{$view->id()}/{$display['id']}/$type",
'attributes' => array('class' => array('icon compact add', 'views-ajax-link'), 'title' => t('Add'), 'id' => 'views-add-' . $type),
'attributes' => array('class' => array('icon compact add', 'views-ajax-link'), 'id' => 'views-add-' . $type),
'html' => TRUE,
);
if ($count_handlers > 0) {
// Create the rearrange text variable for the rearrange action.
$rearrange_text = $type == 'filter' ? t('And/Or Rearrange <span class="element-invisible">filter criteria</span>') : t('Rearrange <span class="element-invisible">@type</span>', array('@type' => $types[$type]['ltitle']));
$actions['rearrange'] = array(
'title' => $rearrange_text,
'href' => $rearrange_url,
'attributes' => array('class' => array($class, 'views-ajax-link'), 'title' => t('Rearrange'), 'id' => 'views-rearrange-' . $type),
'attributes' => array('class' => array($class, 'views-ajax-link'), 'id' => 'views-rearrange-' . $type),
'html' => TRUE,
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment