MOBILE-2795 course: Improve label rendering

main
Pau Ferrer Ocaña 2019-01-02 09:38:47 +01:00
parent 6ebd1c59fe
commit bb9578b493
5 changed files with 27 additions and 1 deletions

View File

@ -1,3 +1,19 @@
a.core-course-module-handler.addon-mod-label-handler {
align-items: center;
&:hover {
opacity: 1;
}
}
.md a.core-course-module-handler.addon-mod-label-handler .item-inner {
padding-bottom: $item-md-padding-bottom;
}
.ios a.core-course-module-handler.addon-mod-label-handler .item-inner {
padding-bottom: $item-ios-padding-bottom;
}
.wp a.core-course-module-handler.addon-mod-label-handler .item-inner {
padding-bottom: $item-wp-padding-bottom;
}

View File

@ -66,6 +66,7 @@ export class AddonModLabelModuleHandler implements CoreCourseModuleHandler {
return {
icon: '',
title: title,
a11yTitle: '',
class: 'addon-mod-label-handler'
};
}

View File

@ -1,4 +1,4 @@
<a *ngIf="module && module.visibleoncoursepage !== 0" ion-item text-wrap id="core-course-module-{{module.id}}" class="core-course-module-handler {{module.handlerData.class}}" (click)="moduleClicked($event)" [ngClass]="{'item-media': module.handlerData.icon, 'core-not-clickable': !module.handlerData.action || !module.uservisible === false, 'item-dimmed': module.visible === 0 || module.uservisible === false}" title="{{ module.handlerData.title }}" detail-none>
<a *ngIf="module && module.visibleoncoursepage !== 0" ion-item text-wrap id="core-course-module-{{module.id}}" class="core-course-module-handler {{module.handlerData.class}}" (click)="moduleClicked($event)" [ngClass]="{'item-media': module.handlerData.icon, 'core-not-clickable': !module.handlerData.action || !module.uservisible === false, 'item-dimmed': module.visible === 0 || module.uservisible === false}" [title]="module.handlerData.a11yTitle" detail-none>
<img item-start *ngIf="module.handlerData.icon" [src]="module.handlerData.icon" alt="" role="presentation" class="core-module-icon">
<div class="core-module-title">

View File

@ -94,6 +94,9 @@ export class CoreCourseModuleComponent implements OnInit, OnDestroy {
}
}, this.sitesProvider.getCurrentSiteId());
}
this.module.handlerData.a11yTitle = typeof this.module.handlerData.a11yTitle != 'undefined' ?
this.module.handlerData.a11yTitle : this.module.handlerData.title;
}
/**

View File

@ -98,6 +98,12 @@ export interface CoreCourseModuleHandlerData {
*/
title: string;
/**
* The accessibility title to use in the module. If not provided, title will be used.
* @type {string}
*/
a11yTitle?: string;
/**
* The image to use as icon (path to the image).
* @type {string}