From bb9578b4932127db9343eb07e989dfb111e8747a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 2 Jan 2019 09:38:47 +0100 Subject: [PATCH] MOBILE-2795 course: Improve label rendering --- src/addon/mod/label/label.scss | 16 ++++++++++++++++ src/addon/mod/label/providers/module-handler.ts | 1 + .../components/module/core-course-module.html | 2 +- src/core/course/components/module/module.ts | 3 +++ src/core/course/providers/module-delegate.ts | 6 ++++++ 5 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/addon/mod/label/label.scss b/src/addon/mod/label/label.scss index aa867a8f1..9f6514ba6 100644 --- a/src/addon/mod/label/label.scss +++ b/src/addon/mod/label/label.scss @@ -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; } diff --git a/src/addon/mod/label/providers/module-handler.ts b/src/addon/mod/label/providers/module-handler.ts index 0e72fac14..8c8ecfeb8 100644 --- a/src/addon/mod/label/providers/module-handler.ts +++ b/src/addon/mod/label/providers/module-handler.ts @@ -66,6 +66,7 @@ export class AddonModLabelModuleHandler implements CoreCourseModuleHandler { return { icon: '', title: title, + a11yTitle: '', class: 'addon-mod-label-handler' }; } diff --git a/src/core/course/components/module/core-course-module.html b/src/core/course/components/module/core-course-module.html index 3e1a12234..559a76c0b 100644 --- a/src/core/course/components/module/core-course-module.html +++ b/src/core/course/components/module/core-course-module.html @@ -1,4 +1,4 @@ - +
diff --git a/src/core/course/components/module/module.ts b/src/core/course/components/module/module.ts index c534cd380..50aff0b44 100644 --- a/src/core/course/components/module/module.ts +++ b/src/core/course/components/module/module.ts @@ -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; } /** diff --git a/src/core/course/providers/module-delegate.ts b/src/core/course/providers/module-delegate.ts index f8d4aac72..3dbf06c42 100644 --- a/src/core/course/providers/module-delegate.ts +++ b/src/core/course/providers/module-delegate.ts @@ -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}