MOBILE-3320 glossary: Don't display empty box before searching
parent
c2d4db837d
commit
7ace30fa80
|
@ -98,7 +98,8 @@
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
|
|
||||||
<core-empty-box *ngIf="entries.empty" icon="fas-list" [message]="'addon.mod_glossary.noentriesfound' | translate">
|
<core-empty-box *ngIf="entries.empty && (!isSearch || hasSearched)" icon="fas-list"
|
||||||
|
[message]="'addon.mod_glossary.noentriesfound' | translate">
|
||||||
</core-empty-box>
|
</core-empty-box>
|
||||||
|
|
||||||
<core-infinite-loading [enabled]="!entries.completed" [error]="loadMoreError" (action)="loadMoreEntries($event)">
|
<core-infinite-loading [enabled]="!entries.completed" [error]="loadMoreError" (action)="loadMoreEntries($event)">
|
||||||
|
|
|
@ -64,6 +64,7 @@ export class AddonModGlossaryIndexComponent extends CoreCourseModuleMainActivity
|
||||||
moduleName = 'glossary';
|
moduleName = 'glossary';
|
||||||
|
|
||||||
isSearch = false;
|
isSearch = false;
|
||||||
|
hasSearched = false;
|
||||||
canAdd = false;
|
canAdd = false;
|
||||||
loadMoreError = false;
|
loadMoreError = false;
|
||||||
loadingMessage?: string;
|
loadingMessage?: string;
|
||||||
|
@ -429,6 +430,7 @@ export class AddonModGlossaryIndexComponent extends CoreCourseModuleMainActivity
|
||||||
toggleSearch(): void {
|
toggleSearch(): void {
|
||||||
if (this.isSearch) {
|
if (this.isSearch) {
|
||||||
this.isSearch = false;
|
this.isSearch = false;
|
||||||
|
this.hasSearched = false;
|
||||||
this.entries.setOnlineEntries(this.fetchedEntries, this.fetchedEntriesCanLoadMore);
|
this.entries.setOnlineEntries(this.fetchedEntries, this.fetchedEntriesCanLoadMore);
|
||||||
this.switchMode(this.fetchMode!);
|
this.switchMode(this.fetchMode!);
|
||||||
} else {
|
} else {
|
||||||
|
@ -488,6 +490,7 @@ export class AddonModGlossaryIndexComponent extends CoreCourseModuleMainActivity
|
||||||
'ASC',
|
'ASC',
|
||||||
);
|
);
|
||||||
this.loaded = false;
|
this.loaded = false;
|
||||||
|
this.hasSearched = true;
|
||||||
this.loadContent();
|
this.loadContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue