diff --git a/src/core/features/course/components/module/core-course-module.html b/src/core/features/course/components/module/core-course-module.html index 437f2f075..fe3204278 100644 --- a/src/core/features/course/components/module/core-course-module.html +++ b/src/core/features/course/components/module/core-course-module.html @@ -1,4 +1,4 @@ - + ; // Data to pass to the component. @Input() preSets?: CoreSiteWSPreSets; // The preSets for the WS call. @Input() pageTitle?: string; // Current page title. It can be used by the "new-content" directives. - @Output() onContentLoaded = new EventEmitter(); // Emits an event when the content is loaded. + @Output() onContentLoaded = new EventEmitter(); // Emits event when content is loaded. @Output() onLoadingContent = new EventEmitter(); // Emits an event when starts to load the content. content?: string; // Content. @@ -114,11 +114,11 @@ export class CoreSitePluginsPluginContentComponent implements OnInit, DoCheck { this.jsData.updateContent = this.updateContent.bind(this); this.jsData.updateModuleCourseContent = this.updateModuleCourseContent.bind(this); - this.onContentLoaded.emit(refresh); + this.onContentLoaded.emit({ refresh: !!refresh, success: true }); } catch (error) { // Make it think it's loaded - otherwise it sticks on 'loading' and stops navigation working. this.content = '
'; - this.onContentLoaded.emit(refresh); + this.onContentLoaded.emit({ refresh: !!refresh, success: false }); CoreDomUtils.showErrorModalDefault(error, 'core.errorloadingcontent', true); } finally { @@ -237,3 +237,8 @@ export class CoreSitePluginsPluginContentComponent implements OnInit, DoCheck { } } + +export type CoreSitePluginsPluginContentLoadedData = { + refresh: boolean; + success: boolean; +};