From 42f44e4945ec0a3cdc5955943230969bf56aa115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 21 Aug 2019 09:48:21 +0200 Subject: [PATCH 1/3] MOBILE-3068 tabs: Fix top tabs flickr --- src/components/tabs/tabs.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/tabs/tabs.ts b/src/components/tabs/tabs.ts index 5d457bfd8..921143228 100644 --- a/src/components/tabs/tabs.ts +++ b/src/components/tabs/tabs.ts @@ -417,6 +417,13 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges, OnDe const scroll = parseInt(scrollElement.scrollTop, 10); if (scroll == this.lastScroll) { + if (scroll == 0) { + // Ensure tabbar is shown. + this.topTabsElement.style.transform = ''; + this.originalTabsContainer.style.transform = ''; + this.originalTabsContainer.style.paddingBottom = this.tabBarHeight + 'px'; + } + // Ensure scroll has been modified to avoid flicks. return; } @@ -438,7 +445,8 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges, OnDe this.originalTabsContainer.style.transform = 'translateY(-' + scroll + 'px)'; this.originalTabsContainer.style.paddingBottom = this.tabBarHeight - scroll + 'px'; } - this.lastScroll = scroll; + // Use lastScroll after moving the tabs to avoid flickering. + this.lastScroll = parseInt(scrollElement.scrollTop, 10); } /** From 486e1d9b11a342f41193edff511b4d9ea934e0a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 21 Aug 2019 10:01:49 +0200 Subject: [PATCH 2/3] MOBILE-3068 blocks: Fix resize uncaught promise --- src/components/tabs/tab.ts | 2 ++ src/core/block/components/course-blocks/course-blocks.ts | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/components/tabs/tab.ts b/src/components/tabs/tab.ts index 9006b3011..fc4aaf2fc 100644 --- a/src/components/tabs/tab.ts +++ b/src/components/tabs/tab.ts @@ -128,6 +128,8 @@ export class CoreTabComponent implements OnInit, OnDestroy { }); this.tabs.showHideTabs(scroll); + }).catch(() => { + // Ignore errors. }); } diff --git a/src/core/block/components/course-blocks/course-blocks.ts b/src/core/block/components/course-blocks/course-blocks.ts index 574dc3c8b..7db1ffa8c 100644 --- a/src/core/block/components/course-blocks/course-blocks.ts +++ b/src/core/block/components/course-blocks/course-blocks.ts @@ -67,6 +67,10 @@ export class CoreBlockCourseBlocksComponent implements OnInit, OnDestroy { * Setup scrolling. */ protected initScroll(): void { + if (this.blocks.length <= 0) { + return; + } + const scroll: HTMLElement = this.content && this.content.getScrollElement(); this.domUtils.waitElementToExist(() => scroll && scroll.querySelector('.core-course-blocks-side')).then((sideElement) => { @@ -89,6 +93,8 @@ export class CoreBlockCourseBlocksComponent implements OnInit, OnDestroy { this.sideScroll.classList.remove('core-course-blocks-fixed-bottom'); this.scrollWorking = false; } + }).catch(() => { + // Ignore errors. }); } From 9f2bb8c4a719c91ad79bd437236994b007c96c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 21 Aug 2019 11:11:28 +0200 Subject: [PATCH 3/3] MOBILE-3068 forum: Hide options if forum not loaded --- .../index/addon-mod-forum-index.html | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/addon/mod/forum/components/index/addon-mod-forum-index.html b/src/addon/mod/forum/components/index/addon-mod-forum-index.html index 8a7dae440..4c8be80bf 100644 --- a/src/addon/mod/forum/components/index/addon-mod-forum-index.html +++ b/src/addon/mod/forum/components/index/addon-mod-forum-index.html @@ -31,17 +31,17 @@ {{ availabilityMessage }} - - - -
- -
- + + + +
+ +
+ @@ -95,9 +95,9 @@ -
- + +