mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
@ -4,6 +4,7 @@ import { StackController } from './stack-controller';
|
|||||||
import { NavController } from '../../providers/nav-controller';
|
import { NavController } from '../../providers/nav-controller';
|
||||||
import { bindLifecycleEvents } from '../../providers/angular-delegate';
|
import { bindLifecycleEvents } from '../../providers/angular-delegate';
|
||||||
import { RouteView, getUrl } from './stack-utils';
|
import { RouteView, getUrl } from './stack-utils';
|
||||||
|
import { Config } from '../../providers';
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: 'ion-router-outlet',
|
selector: 'ion-router-outlet',
|
||||||
@ -34,6 +35,7 @@ export class IonRouterOutlet implements OnDestroy, OnInit {
|
|||||||
@Input()
|
@Input()
|
||||||
set swipeGesture(swipe: boolean) {
|
set swipeGesture(swipe: boolean) {
|
||||||
this._swipeGesture = swipe;
|
this._swipeGesture = swipe;
|
||||||
|
|
||||||
this.nativeEl.swipeHandler = (swipe && this.hasStack) ? {
|
this.nativeEl.swipeHandler = (swipe && this.hasStack) ? {
|
||||||
canStart: () => this.stackCtrl.canGoBack(1),
|
canStart: () => this.stackCtrl.canGoBack(1),
|
||||||
onStart: () => this.stackCtrl.startBackTransition(),
|
onStart: () => this.stackCtrl.startBackTransition(),
|
||||||
@ -48,6 +50,7 @@ export class IonRouterOutlet implements OnDestroy, OnInit {
|
|||||||
@Attribute('name') name: string,
|
@Attribute('name') name: string,
|
||||||
@Optional() @Attribute('tabs') tabs: string,
|
@Optional() @Attribute('tabs') tabs: string,
|
||||||
private changeDetector: ChangeDetectorRef,
|
private changeDetector: ChangeDetectorRef,
|
||||||
|
private config: Config,
|
||||||
navCtrl: NavController,
|
navCtrl: NavController,
|
||||||
elementRef: ElementRef,
|
elementRef: ElementRef,
|
||||||
router: Router,
|
router: Router,
|
||||||
@ -82,7 +85,7 @@ export class IonRouterOutlet implements OnDestroy, OnInit {
|
|||||||
}
|
}
|
||||||
this.nativeEl.componentOnReady().then(() => {
|
this.nativeEl.componentOnReady().then(() => {
|
||||||
if (this._swipeGesture === undefined) {
|
if (this._swipeGesture === undefined) {
|
||||||
this.swipeGesture = this.nativeEl.mode === 'ios';
|
this.swipeGesture = this.config.get('swipeBackEnabled', this.nativeEl.mode === 'ios');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ export function createSwipeBackGesture(
|
|||||||
): Gesture {
|
): Gesture {
|
||||||
const win = el.ownerDocument!.defaultView!;
|
const win = el.ownerDocument!.defaultView!;
|
||||||
function canStart(detail: GestureDetail) {
|
function canStart(detail: GestureDetail) {
|
||||||
return detail.startX <= 5000 && canStartHandler();
|
return detail.startX <= 50 && canStartHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMove(detail: GestureDetail) {
|
function onMove(detail: GestureDetail) {
|
||||||
|
Reference in New Issue
Block a user