diff --git a/src/addon/block/myoverview/components/myoverview/addon-block-myoverview.html b/src/addon/block/myoverview/components/myoverview/addon-block-myoverview.html index ce5b034bc..4275f04b3 100644 --- a/src/addon/block/myoverview/components/myoverview/addon-block-myoverview.html +++ b/src/addon/block/myoverview/components/myoverview/addon-block-myoverview.html @@ -1,7 +1,7 @@

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

-
+
diff --git a/src/addon/block/myoverview/components/myoverview/myoverview.ts b/src/addon/block/myoverview/components/myoverview/myoverview.ts index 13630305e..59b87cb3f 100644 --- a/src/addon/block/myoverview/components/myoverview/myoverview.ts +++ b/src/addon/block/myoverview/components/myoverview/myoverview.ts @@ -177,17 +177,17 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem */ filterChanged(event: any): void { const newValue = event.target.value && event.target.value.trim().toLowerCase(); - if (!newValue || !this.courses[this.selectedFilter]) { - this.filteredCourses = this.courses[this.selectedFilter]; + if (!newValue || !this.courses['all']) { + this.filteredCourses = this.courses['all']; } else { // Use displayname if avalaible, or fullname if not. - if (this.courses[this.selectedFilter].length > 0 && - typeof this.courses[this.selectedFilter][0].displayname != 'undefined') { - this.filteredCourses = this.courses[this.selectedFilter].filter((course) => { + if (this.courses['all'].length > 0 && + typeof this.courses['all'][0].displayname != 'undefined') { + this.filteredCourses = this.courses['all'].filter((course) => { return course.displayname.toLowerCase().indexOf(newValue) > -1; }); } else { - this.filteredCourses = this.courses[this.selectedFilter].filter((course) => { + this.filteredCourses = this.courses['all'].filter((course) => { return course.fullname.toLowerCase().indexOf(newValue) > -1; }); } @@ -311,7 +311,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem switchFilter(): void { this.showFilter = !this.showFilter; this.courses.filter = ''; - this.filteredCourses = this.courses[this.selectedFilter]; + this.filteredCourses = this.courses[this.showFilter ? 'all' : this.selectedFilter]; if (this.showFilter) { setTimeout(() => { this.searchbar.setFocus(); @@ -325,7 +325,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem * @return {boolean} If switch button that enables the filter input is shown or not. */ showFilterSwitchButton(): boolean { - return this.loaded && this.courses[this.selectedFilter] && this.courses[this.selectedFilter].length > 5; + return this.loaded && this.courses['all'] && this.courses['all'].length > 5; } /** diff --git a/src/app/app.ios.scss b/src/app/app.ios.scss index c6d73a607..3a6213ed1 100644 --- a/src/app/app.ios.scss +++ b/src/app/app.ios.scss @@ -1,6 +1,10 @@ ion-app.app-root.ios { .button-ios { - min-height: $button-ios-height + min-height: $button-ios-height; + } + + ion-searchbar.searchbar-ios .button-ios { + min-height: auto; } // Light buttons color.