MOBILE-3120 resource: Display description if setting enabled
parent
f441ce79f7
commit
eb8f286d59
|
@ -13,7 +13,7 @@
|
||||||
<!-- Content. -->
|
<!-- Content. -->
|
||||||
<core-loading [hideUntil]="loaded" class="core-loading-center">
|
<core-loading [hideUntil]="loaded" class="core-loading-center">
|
||||||
|
|
||||||
<core-course-module-description *ngIf="mode != 'iframe'" [description]="description" [component]="component" [componentId]="componentId"></core-course-module-description>
|
<core-course-module-description *ngIf="mode != 'iframe' && (mode != 'embedded' || displayDescription)" [description]="description" [component]="component" [componentId]="componentId"></core-course-module-description>
|
||||||
|
|
||||||
<ng-container *ngIf="mode == 'iframe'">
|
<ng-container *ngIf="mode == 'iframe'">
|
||||||
<core-iframe [src]="src"></core-iframe>
|
<core-iframe [src]="src"></core-iframe>
|
||||||
|
|
|
@ -36,6 +36,7 @@ export class AddonModResourceIndexComponent extends CoreCourseModuleMainResource
|
||||||
mode: string;
|
mode: string;
|
||||||
src: string;
|
src: string;
|
||||||
contentText: string;
|
contentText: string;
|
||||||
|
displayDescription = true;
|
||||||
|
|
||||||
constructor(injector: Injector, private resourceProvider: AddonModResourceProvider, private courseProvider: CoreCourseProvider,
|
constructor(injector: Injector, private resourceProvider: AddonModResourceProvider, private courseProvider: CoreCourseProvider,
|
||||||
private appProvider: CoreAppProvider, private prefetchHandler: AddonModResourcePrefetchHandler,
|
private appProvider: CoreAppProvider, private prefetchHandler: AddonModResourcePrefetchHandler,
|
||||||
|
@ -96,6 +97,8 @@ export class AddonModResourceIndexComponent extends CoreCourseModuleMainResource
|
||||||
}).then((resource) => {
|
}).then((resource) => {
|
||||||
if (resource) {
|
if (resource) {
|
||||||
this.description = resource.intro || resource.description;
|
this.description = resource.intro || resource.description;
|
||||||
|
const options = this.textUtils.unserialize(resource.displayoptions) || {};
|
||||||
|
this.displayDescription = typeof options.printintro == 'undefined' || !!options.printintro;
|
||||||
this.dataRetrieved.emit(resource);
|
this.dataRetrieved.emit(resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue