AS
Size: a a a
AS
AS
AS
let IonBackButtonDelegate = class IonBackButtonDelegate {
constructor(routerOutlet, navCtrl) {
this.routerOutlet = routerOutlet;
this.navCtrl = navCtrl;
}
/**
* @internal
*/
onClick(ev) {
if (this.routerOutlet && this.routerOutlet.canGoBack()) {
this.routerOutlet.pop();
ev.preventDefault();
}
else if (this.defaultHref != null) {
this.navCtrl.navigateBack(this.defaultHref);
ev.preventDefault();
}
}
};
AS
Ć
AS
Ć
AS
AS
export class AppComponent {
@ViewChild(IonRouterOutlet, {static: true}) ionRouter: IonRouterOutlet;
...
subscribeOnBackButtonPress() {
this.platform.backButton.subscribe(()=>{
if( !this.ionRouter.canGoBack() ) {
if( new Date().getTime() - this.lastBackButtonPressTime < this.doubleBackButtonPressTimeout ) {
this.exitApp();
} else {
const options : ToastOptions = {
message: 'Нажмите повторно для выхода из приложения',
position: 'bottom',
color: 'light',
duration: this.doubleBackButtonPressTimeout
};
this.toastController.create(options)
.then(toast=>{
return toast.present();
})
.then(()=>{
this.lastBackButtonPressTime = new Date().getTime();
})
.catch(error=>{
this.logger.log(JSON.stringify(error));
})
}
}
});
}
...
AS
AG
KV
Ć
Ć
Ć
Ć
Ć