mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 08:33:11 +00:00
refactor: simplify favorites and mensa dashboard sections
This commit is contained in:
committed by
Rainer Killinger
parent
47565e51b0
commit
23bd5a431c
@@ -13,10 +13,7 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {Component} from '@angular/core';
|
||||
import {Router} from '@angular/router';
|
||||
import {Capacitor} from '@capacitor/core';
|
||||
import {Keyboard} from '@capacitor/keyboard';
|
||||
import {AnimationBuilder, AnimationController} from '@ionic/angular';
|
||||
import {AnimationController} from '@ionic/angular';
|
||||
import {homePageSearchTransition} from './search-route-transition';
|
||||
|
||||
/**
|
||||
@@ -28,29 +25,7 @@ import {homePageSearchTransition} from './search-route-transition';
|
||||
styleUrls: ['search-section.component.scss'],
|
||||
})
|
||||
export class SearchSectionComponent {
|
||||
searchTerm = '';
|
||||
routeTransition = homePageSearchTransition(this.animationController);
|
||||
|
||||
routeTransition: AnimationBuilder;
|
||||
|
||||
constructor(private router: Router, private animationController: AnimationController) {
|
||||
this.routeTransition = homePageSearchTransition(this.animationController);
|
||||
}
|
||||
|
||||
/**
|
||||
* User submits search
|
||||
*/
|
||||
onSubmitSearch() {
|
||||
this.router
|
||||
.navigate(['/search'], {queryParams: {query: this.searchTerm}})
|
||||
.then(() => this.hideKeyboard());
|
||||
}
|
||||
|
||||
/**
|
||||
* Hides keyboard in native app environments
|
||||
*/
|
||||
hideKeyboard() {
|
||||
if (Capacitor.isNativePlatform()) {
|
||||
Keyboard.hide();
|
||||
}
|
||||
}
|
||||
constructor(private animationController: AnimationController) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user