refactor(nav, menu): swipeEnabled => swipeGesture

This commit is contained in:
Manu Mtz.-Almeida
2018-08-13 18:19:19 +02:00
parent bd5a4a0294
commit 5b6eb2c7eb
11 changed files with 49 additions and 49 deletions

View File

@ -37,11 +37,11 @@ export class Nav implements NavOutlet {
/**
* If the nav component should allow for swipe-to-go-back
*/
@Prop({ mutable: true }) swipeBackEnabled?: boolean;
@Watch('swipeBackEnabled')
swipeBackEnabledChanged() {
@Prop({ mutable: true }) swipeGesture?: boolean;
@Watch('swipeGesture')
swipeGestureChanged() {
if (this.gesture) {
this.gesture.setDisabled(!this.swipeBackEnabled);
this.gesture.setDisabled(!this.swipeGesture);
}
}
@ -95,8 +95,8 @@ export class Nav implements NavOutlet {
!!this.win.document.querySelector('ion-router') &&
!this.el.closest('[no-router]');
if (this.swipeBackEnabled === undefined) {
this.swipeBackEnabled = this.config.getBoolean(
if (this.swipeGesture === undefined) {
this.swipeGesture = this.config.getBoolean(
'swipeBackEnabled',
this.mode === 'ios'
);
@ -121,7 +121,7 @@ export class Nav implements NavOutlet {
onMove: this.swipeBackProgress.bind(this),
onEnd: this.swipeBackEnd.bind(this),
});
this.swipeBackEnabledChanged();
this.swipeGestureChanged();
}
componentDidUnload() {
@ -954,7 +954,7 @@ export class Nav implements NavOutlet {
}
private canSwipeBack(): boolean {
return !!this.swipeBackEnabled && !this.isTransitioning && this.canGoBack();
return !!this.swipeGesture && !this.isTransitioning && this.canGoBack();
}
render() {