From c4f779b1d537eb4660cbb25f4e3a29d6d71d471c Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Tue, 28 Aug 2018 13:45:28 +0200 Subject: [PATCH 1/3] MOBILE-2567 core: Fix descriptions not shortened in dashboard --- src/directives/format-text.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/directives/format-text.ts b/src/directives/format-text.ts index b4bec6d50..ded8c96d9 100644 --- a/src/directives/format-text.ts +++ b/src/directives/format-text.ts @@ -272,6 +272,14 @@ export class CoreFormatTextDirective implements OnChanges { return; } + // In AOT the inputs and ng-reflect aren't in the DOM sometimes. Add them so styles are applied. + if (this.maxHeight && !this.element.getAttribute('maxHeight')) { + this.element.setAttribute('maxHeight', String(this.maxHeight)); + } + if (!this.element.getAttribute('singleLine')) { + this.element.setAttribute('singleLine', String(this.utils.isTrueOrOne(this.singleLine))); + } + this.text = this.text ? this.text.trim() : ''; this.formatContents().then((div: HTMLElement) => { @@ -281,11 +289,6 @@ export class CoreFormatTextDirective implements OnChanges { this.element.innerHTML = ''; // Remove current contents. if (this.maxHeight && div.innerHTML != '') { - // For some reason, in iOS the inputs and ng-reflect aren't in the DOM sometimes. Add it so styles are applied. - if (!this.element.getAttribute('maxHeight')) { - this.element.setAttribute('maxHeight', String(this.maxHeight)); - } - // Move the children to the current element to be able to calculate the height. this.domUtils.moveChildren(div, this.element); From 3a74f4bcbb529018f43fca69da761484b1b678de Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 29 Aug 2018 16:30:24 +0200 Subject: [PATCH 2/3] MOBILE-2567 courses: Fix progress of courses and section download --- src/core/course/components/format/format.scss | 2 +- src/core/course/providers/module-prefetch-delegate.ts | 2 +- src/core/courses/pages/my-overview/my-overview.html | 2 +- src/core/courses/pages/my-overview/my-overview.scss | 8 ++++++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/core/course/components/format/format.scss b/src/core/course/components/format/format.scss index 169018837..f10f68084 100644 --- a/src/core/course/components/format/format.scss +++ b/src/core/course/components/format/format.scss @@ -1,7 +1,7 @@ ion-badge.core-course-download-section-progress { display: block; @include float(start); - @include margin(12px, 12px, null, null); + @include margin(12px, 12px, null, 12px); } core-course-format { diff --git a/src/core/course/providers/module-prefetch-delegate.ts b/src/core/course/providers/module-prefetch-delegate.ts index 722a2cc59..17a8d9f3c 100644 --- a/src/core/course/providers/module-prefetch-delegate.ts +++ b/src/core/course/providers/module-prefetch-delegate.ts @@ -1087,7 +1087,7 @@ export class CoreCourseModulePrefetchDelegate extends CoreDelegate { } return handler.prefetch(module, courseId).then(() => { - const index = moduleIds.indexOf(id); + const index = moduleIds.indexOf(module.id); if (index > -1) { // It's one of the modules we were expecting to download. moduleIds.splice(index, 1); diff --git a/src/core/courses/pages/my-overview/my-overview.html b/src/core/courses/pages/my-overview/my-overview.html index 0a9acea64..37fb4e54b 100644 --- a/src/core/courses/pages/my-overview/my-overview.html +++ b/src/core/courses/pages/my-overview/my-overview.html @@ -47,8 +47,8 @@ + {{prefetchCoursesData[courses.selected].badge}} - {{prefetchCoursesData[courses.selected].badge}} diff --git a/src/core/courses/pages/my-overview/my-overview.scss b/src/core/courses/pages/my-overview/my-overview.scss index 89812f8f7..d698dc081 100644 --- a/src/core/courses/pages/my-overview/my-overview.scss +++ b/src/core/courses/pages/my-overview/my-overview.scss @@ -1,3 +1,7 @@ -page-core-courses-my-courses { - +page-core-courses-my-overview { + ion-badge.core-course-download-courses-progress { + display: block; + @include float(start); + @include margin(12px, 12px, null, 12px); + } } From 70ff6e608ba1361a5c681fc964a6f29aff6b7d4f Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 29 Aug 2018 17:41:38 +0200 Subject: [PATCH 3/3] MOBILE-2567 courses: Fix keyboard closed in iOS when filtering --- src/core/courses/pages/my-courses/my-courses.ts | 2 +- src/core/courses/pages/my-overview/my-overview.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/courses/pages/my-courses/my-courses.ts b/src/core/courses/pages/my-courses/my-courses.ts index e585c2613..6a67618a1 100644 --- a/src/core/courses/pages/my-courses/my-courses.ts +++ b/src/core/courses/pages/my-courses/my-courses.ts @@ -152,7 +152,7 @@ export class CoreCoursesMyCoursesPage implements OnDestroy { if (this.showFilter) { setTimeout(() => { this.searchbar.setFocus(); - }); + }, 500); } } diff --git a/src/core/courses/pages/my-overview/my-overview.ts b/src/core/courses/pages/my-overview/my-overview.ts index 8a7e323c8..cb3b58745 100644 --- a/src/core/courses/pages/my-overview/my-overview.ts +++ b/src/core/courses/pages/my-overview/my-overview.ts @@ -283,7 +283,7 @@ export class CoreCoursesMyOverviewPage implements OnDestroy { if (this.showFilter) { setTimeout(() => { this.searchbar.setFocus(); - }); + }, 500); } }