Add aria-label to project select role without label
This commit is contained in:
parent
87c123bba4
commit
6231c159b8
|
|
@ -21,6 +21,7 @@
|
|||
'roles' => $roles,
|
||||
'role' => $group['role'],
|
||||
'id' => $group['id'],
|
||||
'ariaLabel' => t('Role'),
|
||||
'url' => $this->url->to('ProjectPermissionController', 'changeGroupRole', array('project_id' => $project['id'])),
|
||||
)) ?>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
'roles' => $roles,
|
||||
'role' => $user['role'],
|
||||
'id' => $user['id'],
|
||||
'ariaLabel' => t('Role'),
|
||||
'url' => $this->url->to('ProjectPermissionController', 'changeUserRole', array('project_id' => $project['id'])),
|
||||
)) ?>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -33,6 +33,14 @@ KB.component('project-select-role', function (containerElement, options) {
|
|||
containerElement.appendChild(componentElement);
|
||||
}
|
||||
|
||||
function getAriaLabelValue() {
|
||||
if (options.ariaLabel) {
|
||||
return options.ariaLabel;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
function buildComponentElement() {
|
||||
var roles = [];
|
||||
var container = KB.dom('div');
|
||||
|
|
@ -49,7 +57,7 @@ KB.component('project-select-role', function (containerElement, options) {
|
|||
}
|
||||
}
|
||||
|
||||
container.add(KB.dom('select').change(onChange).for('option', roles).build());
|
||||
container.add(KB.dom('select').attr('aria-label', getAriaLabelValue()).change(onChange).for('option', roles).build());
|
||||
|
||||
if (isLoading) {
|
||||
container.text(' ');
|
||||
|
|
|
|||
Loading…
Reference in New Issue