MOBILE-2795 data: Change toggle search tab behaviour

main
Pau Ferrer Ocaña 2019-01-10 14:26:37 +01:00
parent 7c933ba15e
commit 6727325d8e
2 changed files with 6 additions and 4 deletions

View File

@ -10,8 +10,8 @@
</ion-header>
<ion-content>
<div class="fixed-content core-tabs-bar">
<a class="tab-slide" [attr.aria-selected]="!search.searchingAdvanced" (click)="toggleAdvanced()">{{ 'addon.mod_data.search' | translate}}</a>
<a class="tab-slide" [attr.aria-selected]="search.searchingAdvanced" (click)="toggleAdvanced()">{{ 'addon.mod_data.advancedsearch' | translate }}</a>
<a class="tab-slide" [attr.aria-selected]="!search.searchingAdvanced" (click)="changeAdvanced(false)">{{ 'addon.mod_data.search' | translate}}</a>
<a class="tab-slide" [attr.aria-selected]="search.searchingAdvanced" (click)="changeAdvanced(true)">{{ 'addon.mod_data.advancedsearch' | translate }}</a>
</div>
<form (ngSubmit)="searchEntries($event)" [formGroup]="searchForm">
<ion-list no-margin>

View File

@ -176,9 +176,11 @@ export class AddonModDataSearchPage {
/**
* Toggles between advanced to normal search.
*
* @param {boolean} advanced True for advanced, false for basic.
*/
toggleAdvanced(): void {
this.search.searchingAdvanced = !this.search.searchingAdvanced;
changeAdvanced(advanced: boolean): void {
this.search.searchingAdvanced = advanced;
}
/**