Add aria label to umbraco property
This commit is contained in:
committed by
Michael Latouche
parent
b6f0db7b73
commit
612b6039f2
@@ -64,10 +64,13 @@
|
||||
|
||||
function onInit() {
|
||||
vm.controlLabelTitle = null;
|
||||
vm.controlAriaLabel = null;
|
||||
if (Umbraco.Sys.ServerVariables.isDebuggingEnabled) {
|
||||
userService.getCurrentUser().then(function (u) {
|
||||
if (u.allowedSections.indexOf("settings") !== -1 ? true : false) {
|
||||
vm.controlLabelTitle = vm.property.alias;
|
||||
// capitalize first letter of the alias for screen readers
|
||||
vm.controlAriaLabel = vm.property.alias.charAt(0).toUpperCase() + vm.property.alias.slice(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<div class="control-header" ng-hide="(vm.hideLabel || vm.property.hideLabel) === true">
|
||||
|
||||
<label data-element="property-label-{{vm.property.alias}}" class="control-label" for="{{vm.property.alias}}" ng-attr-title="{{vm.controlLabelTitle}}">{{vm.property.label}}<span ng-if="vm.property.validation.mandatory || vm.property.ncMandatory"><strong class="umb-control-required">*</strong></span></label>
|
||||
<label data-element="property-label-{{vm.property.alias}}" class="control-label" for="{{vm.property.alias}}" ng-attr-title="{{vm.controlLabelTitle}}" aria-label="Property alias: {{vm.controlAriaLabel}}">{{vm.property.label}}<span ng-if="vm.property.validation.mandatory || vm.property.ncMandatory"><strong class="umb-control-required">*</strong></span></label>
|
||||
|
||||
<umb-property-actions actions="vm.propertyActions"></umb-property-actions>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user