0 ? 'light' : ''" [class.core-danger-item]="item.isEmpty || item.hasError">
{{item.itemnumber}}.
-
+
{{item.postfix}}
diff --git a/src/addon/mod/folder/components/index/index.ts b/src/addon/mod/folder/components/index/index.ts
index 573b4dfb6..922ec3836 100644
--- a/src/addon/mod/folder/components/index/index.ts
+++ b/src/addon/mod/folder/components/index/index.ts
@@ -105,7 +105,7 @@ export class AddonModFolderIndexComponent extends CoreCourseModuleMainResourceCo
if (this.canGetFolder) {
promise = this.folderProvider.getFolder(this.courseId, this.module.id).then((folder) => {
- return this.courseProvider.loadModuleContents(this.module, this.courseId).then(() => {
+ return this.courseProvider.loadModuleContents(this.module, this.courseId, undefined, false, refresh).then(() => {
folderContents = this.module.contents;
return folder;
diff --git a/src/addon/notes/components/list/addon-notes-list.html b/src/addon/notes/components/list/addon-notes-list.html
index 903727ec3..0409e6aae 100644
--- a/src/addon/notes/components/list/addon-notes-list.html
+++ b/src/addon/notes/components/list/addon-notes-list.html
@@ -53,7 +53,7 @@
- {{ note.content }}
+
diff --git a/src/components/rich-text-editor/rich-text-editor.ts b/src/components/rich-text-editor/rich-text-editor.ts
index 83d4baaef..d4367e509 100644
--- a/src/components/rich-text-editor/rich-text-editor.ts
+++ b/src/components/rich-text-editor/rich-text-editor.ts
@@ -180,18 +180,19 @@ export class CoreRichTextEditorComponent implements AfterContentInit, OnDestroy
if (this.platform.is('android')) {
// In Android we ignore the keyboard height because it is not part of the web view.
height = this.domUtils.getContentHeight(this.content) - this.getSurroundingHeight(this.element);
- } else if (this.platform.is('ios') && this.kbHeight > 0) {
- // Keyboard open in iOS.
- // In this case, the header disappears or is scrollable, so we need to adjust the calculations.
+ } else if (this.platform.is('ios') && this.kbHeight > 0 && this.platform.version().major < 12) {
+ // Keyboard open in iOS 11 or previous. The window height changes when the keyboard is open.
height = window.innerHeight - this.getSurroundingHeight(this.element);
if (this.element.getBoundingClientRect().top < 40) {
// In iOS sometimes the editor is placed below the status bar. Move the scroll a bit so it doesn't happen.
window.scrollTo(window.scrollX, window.scrollY - 40);
}
+
} else {
// Header is fixed, use the content to calculate the editor height.
height = this.domUtils.getContentHeight(this.content) - this.kbHeight - this.getSurroundingHeight(this.element);
+
}
if (height > this.minHeight) {
@@ -549,12 +550,14 @@ export class CoreRichTextEditorComponent implements AfterContentInit, OnDestroy
}
/**
- * Hide the toolbar.
+ * Hide the toolbar in phone mode.
*/
hideToolbar($event: any): void {
this.stopBubble($event);
- this.toolbarHidden = true;
+ if (this.isPhone) {
+ this.toolbarHidden = true;
+ }
}
/**
diff --git a/src/core/course/providers/helper.ts b/src/core/course/providers/helper.ts
index 1ac9e5e90..d386f1a58 100644
--- a/src/core/course/providers/helper.ts
+++ b/src/core/course/providers/helper.ts
@@ -661,7 +661,6 @@ export class CoreCourseHelperProvider {
const mainFile = files[0],
fileUrl = this.fileHelper.getFileUrl(mainFile),
- timemodified = this.fileHelper.getFileTimemodified(mainFile),
result = {
fixedUrl: undefined,
path: undefined,
@@ -678,48 +677,23 @@ export class CoreCourseHelperProvider {
return this.filepoolProvider.getPackageStatus(siteId, component, componentId).then((status) => {
result.status = status;
- const isWifi = this.appProvider.isWifi(),
- isOnline = this.appProvider.isOnline();
-
if (status === CoreConstants.DOWNLOADED) {
// Get the local file URL.
return this.filepoolProvider.getInternalUrlByUrl(siteId, fileUrl).catch((error) => {
- // File not found, mark the module as not downloaded and reject.
+ // File not found, mark the module as not downloaded and try again.
return this.filepoolProvider.storePackageStatus(siteId, CoreConstants.NOT_DOWNLOADED, component,
componentId).then(() => {
- return Promise.reject(error);
+ return this.downloadModuleWithMainFile(module, courseId, fixedUrl, files, status, component,
+ componentId, siteId);
});
});
} else if (status === CoreConstants.DOWNLOADING && !this.appProvider.isDesktop()) {
// Return the online URL.
return fixedUrl;
} else {
- if (!isOnline && status === CoreConstants.NOT_DOWNLOADED) {
- // Not downloaded and we're offline, reject.
- return Promise.reject(this.translate.instant('core.networkerrormsg'));
- }
-
- return this.filepoolProvider.shouldDownloadBeforeOpen(fixedUrl, mainFile.filesize).then(() => {
- // Download and then return the local URL.
- return this.downloadModule(module, courseId, component, componentId, files, siteId).then(() => {
- return this.filepoolProvider.getInternalUrlByUrl(siteId, fileUrl);
- });
- }, () => {
- // Start the download if in wifi, but return the URL right away so the file is opened.
- if (isWifi) {
- this.downloadModule(module, courseId, component, componentId, files, siteId);
- }
-
- if (!this.fileHelper.isStateDownloaded(status) || isOnline) {
- // Not downloaded or online, return the online URL.
- return fixedUrl;
- } else {
- // Outdated but offline, so we return the local URL. Use getUrlByUrl so it's added to the queue.
- return this.filepoolProvider.getUrlByUrl(siteId, fileUrl, component, componentId, timemodified,
- false, false, mainFile);
- }
- });
+ return this.downloadModuleWithMainFile(module, courseId, fixedUrl, files, status, component, componentId,
+ siteId);
}
}).then((path) => {
result.path = path;
@@ -735,6 +709,55 @@ export class CoreCourseHelperProvider {
});
}
+ /**
+ * Convenience function to download a module that has a main file and return the local file's path and other info.
+ * This is meant for modules like mod_resource.
+ *
+ * @param module The module to download.
+ * @param courseId The course ID of the module.
+ * @param fixedUrl Main file's fixed URL.
+ * @param files List of files of the module.
+ * @param status The package status.
+ * @param component The component to link the files to.
+ * @param componentId An ID to use in conjunction with the component.
+ * @param siteId The site ID. If not defined, current site.
+ * @return Promise resolved when done.
+ */
+ protected downloadModuleWithMainFile(module: any, courseId: number, fixedUrl: string, files: any[], status: string,
+ component?: string, componentId?: string | number, siteId?: string): Promise {
+
+ const isOnline = this.appProvider.isOnline();
+ const mainFile = files[0];
+ const fileUrl = this.fileHelper.getFileUrl(mainFile);
+ const timemodified = this.fileHelper.getFileTimemodified(mainFile);
+
+ if (!isOnline && status === CoreConstants.NOT_DOWNLOADED) {
+ // Not downloaded and we're offline, reject.
+ return Promise.reject(this.translate.instant('core.networkerrormsg'));
+ }
+
+ return this.filepoolProvider.shouldDownloadBeforeOpen(fixedUrl, mainFile.filesize).then(() => {
+ // Download and then return the local URL.
+ return this.downloadModule(module, courseId, component, componentId, files, siteId).then(() => {
+ return this.filepoolProvider.getInternalUrlByUrl(siteId, fileUrl);
+ });
+ }, () => {
+ // Start the download if in wifi, but return the URL right away so the file is opened.
+ if (this.appProvider.isWifi()) {
+ this.downloadModule(module, courseId, component, componentId, files, siteId);
+ }
+
+ if (!this.fileHelper.isStateDownloaded(status) || isOnline) {
+ // Not downloaded or online, return the online URL.
+ return fixedUrl;
+ } else {
+ // Outdated but offline, so we return the local URL. Use getUrlByUrl so it's added to the queue.
+ return this.filepoolProvider.getUrlByUrl(siteId, fileUrl, component, componentId, timemodified,
+ false, false, mainFile);
+ }
+ });
+ }
+
/**
* Convenience function to download a module.
*