MOBILE-2539 url: Support display description setting
parent
f090f8f33a
commit
6d39cd5c4f
|
@ -10,7 +10,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="displayDescription" [description]="description" [component]="component" [componentId]="componentId"></core-course-module-description>
|
||||||
|
|
||||||
<div *ngIf="shouldEmbed" class="addon-mod_url-embedded-url">
|
<div *ngIf="shouldEmbed" class="addon-mod_url-embedded-url">
|
||||||
<img *ngIf="isImage" title="{{name}}" [src]="url">
|
<img *ngIf="isImage" title="{{name}}" [src]="url">
|
||||||
|
|
|
@ -40,6 +40,7 @@ export class AddonModUrlIndexComponent extends CoreCourseModuleMainResourceCompo
|
||||||
isAudio = false;
|
isAudio = false;
|
||||||
isVideo = false;
|
isVideo = false;
|
||||||
mimetype: string;
|
mimetype: string;
|
||||||
|
displayDescription = true;
|
||||||
|
|
||||||
constructor(injector: Injector, private urlProvider: AddonModUrlProvider, private courseProvider: CoreCourseProvider,
|
constructor(injector: Injector, private urlProvider: AddonModUrlProvider, private courseProvider: CoreCourseProvider,
|
||||||
private urlHelper: AddonModUrlHelperProvider, private mimeUtils: CoreMimetypeUtilsProvider,
|
private urlHelper: AddonModUrlHelperProvider, private mimeUtils: CoreMimetypeUtilsProvider,
|
||||||
|
@ -98,6 +99,11 @@ export class AddonModUrlIndexComponent extends CoreCourseModuleMainResourceCompo
|
||||||
this.description = url.intro || url.description;
|
this.description = url.intro || url.description;
|
||||||
this.dataRetrieved.emit(url);
|
this.dataRetrieved.emit(url);
|
||||||
|
|
||||||
|
if (canGetUrl && url.displayoptions) {
|
||||||
|
const unserialized = this.textUtils.unserialize(url.displayoptions);
|
||||||
|
this.displayDescription = typeof unserialized.printintro == 'undefined' || !!unserialized.printintro;
|
||||||
|
}
|
||||||
|
|
||||||
if (!canGetUrl) {
|
if (!canGetUrl) {
|
||||||
mod = url;
|
mod = url;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue