From 94ec1c973455d7f64062c1dfe013ec2901102a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 31 May 2021 11:13:05 +0200 Subject: [PATCH] MOBILE-3320 core: Improve inline loading styles --- .../addon-block-activitymodules.html | 2 +- .../myoverview/addon-block-myoverview.html | 2 +- .../addon-block-recentlyaccessedcourses.html | 2 +- .../addon-block-recentlyaccesseditems.html | 2 +- .../addon-block-sitemainmenu.html | 2 +- .../addon-block-starredcourses.html | 2 +- .../timeline/addon-block-timeline.html | 6 +- .../messages/pages/discussion/discussion.html | 2 +- .../addon-mod-assign-submission.html | 2 +- .../post-options-menu/post-options-menu.html | 2 +- src/core/components/loading/core-loading.html | 6 +- src/core/components/loading/loading.scss | 62 ++++++++++++------- .../core-block-course-blocks.html | 2 +- .../core-block-pre-rendered.html | 2 +- .../components/comments/core-comments.html | 2 +- .../courses/pages/my-courses/my-courses.html | 2 +- .../core-siteplugins-plugin-content.html | 2 +- 17 files changed, 57 insertions(+), 45 deletions(-) diff --git a/src/addons/block/activitymodules/components/activitymodules/addon-block-activitymodules.html b/src/addons/block/activitymodules/components/activitymodules/addon-block-activitymodules.html index fbd46e52c..c23efa667 100644 --- a/src/addons/block/activitymodules/components/activitymodules/addon-block-activitymodules.html +++ b/src/addons/block/activitymodules/components/activitymodules/addon-block-activitymodules.html @@ -3,7 +3,7 @@

{{ 'addon.block_activitymodules.pluginname' | translate }}

- + diff --git a/src/addons/block/myoverview/components/myoverview/addon-block-myoverview.html b/src/addons/block/myoverview/components/myoverview/addon-block-myoverview.html index 405246a1f..87fb9b52f 100644 --- a/src/addons/block/myoverview/components/myoverview/addon-block-myoverview.html +++ b/src/addons/block/myoverview/components/myoverview/addon-block-myoverview.html @@ -36,7 +36,7 @@ - +
diff --git a/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/addon-block-recentlyaccessedcourses.html b/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/addon-block-recentlyaccessedcourses.html index e5cc1f9e0..e65ea9c0d 100644 --- a/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/addon-block-recentlyaccessedcourses.html +++ b/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/addon-block-recentlyaccessedcourses.html @@ -20,7 +20,7 @@
- + diff --git a/src/addons/block/recentlyaccesseditems/components/recentlyaccesseditems/addon-block-recentlyaccesseditems.html b/src/addons/block/recentlyaccesseditems/components/recentlyaccesseditems/addon-block-recentlyaccesseditems.html index 4990142ad..f63f935a5 100644 --- a/src/addons/block/recentlyaccesseditems/components/recentlyaccesseditems/addon-block-recentlyaccesseditems.html +++ b/src/addons/block/recentlyaccesseditems/components/recentlyaccesseditems/addon-block-recentlyaccesseditems.html @@ -5,7 +5,7 @@ - +
{{ 'addon.block_sitemainmenu.pluginname' | translate }} - + diff --git a/src/addons/block/starredcourses/components/starredcourses/addon-block-starredcourses.html b/src/addons/block/starredcourses/components/starredcourses/addon-block-starredcourses.html index 21147e0c5..b207895af 100644 --- a/src/addons/block/starredcourses/components/starredcourses/addon-block-starredcourses.html +++ b/src/addons/block/starredcourses/components/starredcourses/addon-block-starredcourses.html @@ -20,7 +20,7 @@
- + diff --git a/src/addons/block/timeline/components/timeline/addon-block-timeline.html b/src/addons/block/timeline/components/timeline/addon-block-timeline.html index fcba46bf8..f8d82393d 100644 --- a/src/addons/block/timeline/components/timeline/addon-block-timeline.html +++ b/src/addons/block/timeline/components/timeline/addon-block-timeline.html @@ -9,7 +9,7 @@ - +
@@ -35,12 +35,12 @@
- + + [fullscreen]="false" class="safe-area-page margin"> diff --git a/src/addons/messages/pages/discussion/discussion.html b/src/addons/messages/pages/discussion/discussion.html index 2d0b64d50..cffcc0f16 100644 --- a/src/addons/messages/pages/discussion/discussion.html +++ b/src/addons/messages/pages/discussion/discussion.html @@ -128,7 +128,7 @@ + [attr.aria-label]="'addon.messages.newmessages' | translate"> {{ newMessages }} diff --git a/src/addons/mod/assign/components/submission/addon-mod-assign-submission.html b/src/addons/mod/assign/components/submission/addon-mod-assign-submission.html index ddc9d6b2c..09d1c6416 100644 --- a/src/addons/mod/assign/components/submission/addon-mod-assign-submission.html +++ b/src/addons/mod/assign/components/submission/addon-mod-assign-submission.html @@ -1,4 +1,4 @@ - + + diff --git a/src/core/components/loading/core-loading.html b/src/core/components/loading/core-loading.html index 2bffacab4..7f5006545 100644 --- a/src/core/components/loading/core-loading.html +++ b/src/core/components/loading/core-loading.html @@ -1,8 +1,6 @@
- - -

{{message}}

-
+ +

{{message}}

diff --git a/src/core/components/loading/loading.scss b/src/core/components/loading/loading.scss index 2cb4ac8ea..ba0bcd3d6 100644 --- a/src/core/components/loading/loading.scss +++ b/src/core/components/loading/loading.scss @@ -4,35 +4,44 @@ --loading-background: var(--ion-background-color); --loading-spinner: var(--ion-color-primary); --loading-text-color: var(--ion-text-color); + --loading-inline-margin: 0; + --loading-inline-min-height: 28px; position: static; color: var(--loading-text-color); + &.margin { + --loading-inline-margin: 10px; + } + + &.core-loading-loaded { + --loading-inline-margin: 0; + --loading-inline-min-height: 0; + } + ion-spinner { --color: var(--loading-spinner); color: var(--color); } - > .core-loading-container { + .core-loading-container { position: absolute; @include position(0, 0, 0, 0); - display: table; + display: flex; height: 100%; width: 100%; - text-align: center; - clear: both; + justify-content: center; + align-items: center; + flex-direction: column; z-index: 3; margin: 0; - padding: 10px 0 0 0; + padding: 0; background-color: var(--loading-background); - -webkit-transition: all 200ms ease-in-out; - transition: all 200ms ease-in-out; + @include core-transition(all, 200ms); + } - .core-loading-spinner { - display: table-cell; - text-align: center; - vertical-align: middle; - } + .core-loading-message { + @include margin(10px, 0, 0, 0); } .core-loading-content { @@ -48,21 +57,26 @@ } &.core-loading-inline { - display: block; - - .core-loading-container { - padding-top: 20px; - position: relative; - } - } - - &.core-loading-loaded.core-loading-inline { + --loading-background: transparent; position: relative; - min-height: 102px; + display: block; + min-height: var(--loading-inline-min-height); + margin-top: var(--loading-inline-margin); + margin-bottom: var(--loading-inline-margin); + + .core-loading-message { + @include margin(0, 0, 0, 10px); + } .core-loading-container { - padding-top: 10px; - position: absolute; + flex-direction: row; } } } + +:host-context(ion-item) { + &.core-loading-inline { + position: static; + display: block; + } +} diff --git a/src/core/features/block/components/course-blocks/core-block-course-blocks.html b/src/core/features/block/components/course-blocks/core-block-course-blocks.html index 120e60749..74e57a9b2 100644 --- a/src/core/features/block/components/course-blocks/core-block-course-blocks.html +++ b/src/core/features/block/components/course-blocks/core-block-course-blocks.html @@ -3,7 +3,7 @@
- + diff --git a/src/core/features/block/components/pre-rendered-block/core-block-pre-rendered.html b/src/core/features/block/components/pre-rendered-block/core-block-pre-rendered.html index 46b579a07..f1cf8b8d4 100644 --- a/src/core/features/block/components/pre-rendered-block/core-block-pre-rendered.html +++ b/src/core/features/block/components/pre-rendered-block/core-block-pre-rendered.html @@ -7,7 +7,7 @@ - + +
{{ 'core.comments.commentscount' | translate : {'$a': commentsCount} }}
diff --git a/src/core/features/courses/pages/my-courses/my-courses.html b/src/core/features/courses/pages/my-courses/my-courses.html index dcb81531f..e48166389 100644 --- a/src/core/features/courses/pages/my-courses/my-courses.html +++ b/src/core/features/courses/pages/my-courses/my-courses.html @@ -12,7 +12,7 @@ + (click)="prefetchCourses()" [attr.aria-label]="'core.courses.downloadcourses' | translate"> +