MOBILE-2910 icon: Fix aria-label set
parent
4015641ee5
commit
ba871d4e5c
|
@ -27,7 +27,7 @@
|
|||
<ion-avatar core-user-avatar [user]="member" [linkProfile]="false" [checkOnline]="member.showonlinestatus" item-start></ion-avatar>
|
||||
<h2>
|
||||
<core-format-text [text]="member.fullname"></core-format-text>
|
||||
<core-icon name="fa-ban" *ngIf="member.isblocked" [attr.aria-label]="'addon.messages.contactblocked' | translate"></core-icon>
|
||||
<core-icon name="fa-ban" *ngIf="member.isblocked" [label]="'addon.messages.contactblocked' | translate"></core-icon>
|
||||
</h2>
|
||||
</a>
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@
|
|||
|
||||
<h2>
|
||||
<core-format-text [text]="conversation.name"></core-format-text>
|
||||
<core-icon name="fa-ban" *ngIf="conversation.isblocked" [attr.aria-label]="'addon.messages.contactblocked' | translate"></core-icon>
|
||||
<core-icon name="fa-ban" *ngIf="conversation.isblocked" [label]="'addon.messages.contactblocked' | translate"></core-icon>
|
||||
</h2>
|
||||
<ion-note *ngIf="conversation.lastmessagedate > 0 || conversation.unreadcount">
|
||||
<ion-badge *ngIf="conversation.unreadcount > 0">{{ conversation.unreadcount }}</ion-badge>
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<ion-avatar item-start core-user-avatar [user]="result" [checkOnline]="true" [linkProfile]="false"></ion-avatar>
|
||||
<h2>
|
||||
<core-format-text [text]="result.fullname"></core-format-text>
|
||||
<core-icon name="fa-ban" *ngIf="result.isblocked" [attr.aria-label]="'addon.messages.contactblocked' | translate"></core-icon>
|
||||
<core-icon name="fa-ban" *ngIf="result.isblocked" [label]="'addon.messages.contactblocked' | translate"></core-icon>
|
||||
</h2>
|
||||
<ion-note *ngIf="result.lastmessagedate > 0">
|
||||
{{result.lastmessagedate | coreDateDayOrTime}}
|
||||
|
|
|
@ -25,9 +25,10 @@
|
|||
<span *ngIf="question.number">{{ 'core.question.questionno' | translate:{$a: question.number} }}</span>
|
||||
<span *ngIf="!question.number">{{ 'core.question.information' | translate }}</span>
|
||||
<core-icon item-content *ngIf="!question.number" name="information-circle" color="info"></core-icon>
|
||||
<core-icon item-content *ngIf="question.stateClass == 'core-question-correct'" name="fa-check" color="success"></core-icon>
|
||||
<core-icon item-content *ngIf="question.stateClass == 'core-question-partiallycorrect'" name="fa-check-square" color="warning"></core-icon>
|
||||
<core-icon item-content *ngIf="question.stateClass == 'core-question-incorrect' || question.stateClass == 'core-question-notanswered'" name="fa-remove" color="danger"></core-icon>
|
||||
<core-icon item-content *ngIf="question.stateClass == 'core-question-requiresgrading'" name="fa-question-circle" color="gray" [label]="question.status"></core-icon>
|
||||
<core-icon item-content *ngIf="question.stateClass == 'core-question-correct'" name="fa-check" color="success" [label]="question.status"></core-icon>
|
||||
<core-icon item-content *ngIf="question.stateClass == 'core-question-partiallycorrect'" name="fa-check-square" color="warning" [label]="question.status"></core-icon>
|
||||
<core-icon item-content *ngIf="question.stateClass == 'core-question-incorrect' || question.stateClass == 'core-question-notanswered'" name="fa-remove" color="danger" [label]="question.status"></core-icon>
|
||||
</a>
|
||||
|
||||
<!-- In player, show button to finish attempt. -->
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<ion-list [id]="uniqueId" role="menu">
|
||||
<ion-list-header *ngIf="title">{{title}}</ion-list-header>
|
||||
<a ion-item text-wrap *ngFor="let item of items" core-link [capture]="item.captureLink" [autoLogin]="item.autoLogin" [href]="item.href" (click)="itemClicked($event, item)" [attr.aria-label]="item.ariaAction" [hidden]="item.hidden" [attr.detail-none]="!item.href || item.iconAction" role="menuitem" [attr.aria-controls]="uniqueId">
|
||||
<core-icon *ngIf="item.iconDescription" [name]="item.iconDescription" [attr.aria-label]="item.ariaDescription" item-start></core-icon>
|
||||
<core-icon *ngIf="item.iconDescription" [name]="item.iconDescription" [label]="item.ariaDescription" item-start></core-icon>
|
||||
<core-format-text [clean]="true" [text]="item.content"></core-format-text>
|
||||
<core-icon *ngIf="(item.href || item.action) && item.iconAction && item.iconAction != 'spinner'" [name]="item.iconAction" item-end></core-icon>
|
||||
<ion-spinner *ngIf="(item.href || item.action) && item.iconAction == 'spinner'" item-end></ion-spinner>
|
||||
|
|
|
@ -1 +1 @@
|
|||
<ion-icon [name]="name" [isActive]="isActive" [md]="md" [ios]="ios" [color]="color" aria-hidden="true" role="presentation"></ion-icon>
|
||||
<ion-icon [name]="name" [isActive]="isActive" [md]="md" [ios]="ios" [color]="color"></ion-icon>
|
|
@ -37,6 +37,8 @@ export class CoreIconComponent implements OnInit, OnDestroy {
|
|||
// FontAwesome params.
|
||||
@Input('fixed-width') fixedWidth: string;
|
||||
|
||||
@Input('label') ariaLabel?: string;
|
||||
|
||||
protected element: HTMLElement;
|
||||
protected newElement: HTMLElement;
|
||||
|
||||
|
@ -54,8 +56,6 @@ export class CoreIconComponent implements OnInit, OnDestroy {
|
|||
this.newElement.classList.add('icon');
|
||||
this.newElement.classList.add('fa');
|
||||
this.newElement.classList.add(this.name);
|
||||
this.newElement.setAttribute('aria-hidden', 'true');
|
||||
this.newElement.setAttribute('role', 'img');
|
||||
if (this.isTrueProperty(this.fixedWidth)) {
|
||||
this.newElement.classList.add('fa-fw');
|
||||
}
|
||||
|
@ -66,6 +66,10 @@ export class CoreIconComponent implements OnInit, OnDestroy {
|
|||
this.newElement = <HTMLElement> this.element.firstElementChild;
|
||||
}
|
||||
|
||||
!this.ariaLabel && this.newElement.setAttribute('aria-hidden', 'true');
|
||||
!this.ariaLabel && this.newElement.setAttribute('role', 'presentation');
|
||||
this.ariaLabel && this.newElement.setAttribute('aria-label', this.ariaLabel);
|
||||
|
||||
const attrs = this.element.attributes;
|
||||
for (let i = attrs.length - 1; i >= 0; i--) {
|
||||
if (attrs[i].name == 'class') {
|
||||
|
|
Loading…
Reference in New Issue