MOBILE-2795 url: Log view on embedded content
parent
8cafbfdd9f
commit
75551cfc72
|
@ -57,7 +57,12 @@ export class AddonModUrlIndexComponent extends CoreCourseModuleMainResourceCompo
|
||||||
|
|
||||||
this.canGetUrl = this.urlProvider.isGetUrlWSAvailable();
|
this.canGetUrl = this.urlProvider.isGetUrlWSAvailable();
|
||||||
|
|
||||||
this.loadContent();
|
this.loadContent().then(() => {
|
||||||
|
if ((this.shouldIframe || (this.shouldEmbed && this.isOther)) ||
|
||||||
|
(!this.shouldIframe && (!this.shouldEmbed || !this.isOther))) {
|
||||||
|
this.logView();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -168,14 +173,23 @@ export class AddonModUrlIndexComponent extends CoreCourseModuleMainResourceCompo
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens a file.
|
* Log view into the site and checks module completion.
|
||||||
|
*
|
||||||
|
* @return {Promise<void>} Promise resolved when done.
|
||||||
*/
|
*/
|
||||||
go(): void {
|
protected logView(): Promise<void> {
|
||||||
this.urlProvider.logView(this.module.instance).then(() => {
|
return this.urlProvider.logView(this.module.instance).then(() => {
|
||||||
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completiondata);
|
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completiondata);
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
// Ignore errors.
|
// Ignore errors.
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Opens a file.
|
||||||
|
*/
|
||||||
|
go(): void {
|
||||||
|
this.logView();
|
||||||
this.urlHelper.open(this.url);
|
this.urlHelper.open(this.url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue