mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 21:48:42 +08:00
fix(tabs): fix tabs rootNav
This commit is contained in:
@ -509,7 +509,7 @@ export class Tabs extends Ion {
|
|||||||
*/
|
*/
|
||||||
get rootNav(): NavController {
|
get rootNav(): NavController {
|
||||||
let nav = this.parent;
|
let nav = this.parent;
|
||||||
while (nav.parent) {
|
while (nav && nav.parent) {
|
||||||
nav = nav.parent;
|
nav = nav.parent;
|
||||||
}
|
}
|
||||||
return nav;
|
return nav;
|
||||||
|
@ -25,7 +25,7 @@ export class PointerEvents {
|
|||||||
private pointerUp: any,
|
private pointerUp: any,
|
||||||
private zone: boolean,
|
private zone: boolean,
|
||||||
private option: any) {
|
private option: any) {
|
||||||
|
|
||||||
this.rmTouchStart = listenEvent(ele, 'touchstart', zone, option, (ev: any) => this.handleTouchStart(ev));
|
this.rmTouchStart = listenEvent(ele, 'touchstart', zone, option, (ev: any) => this.handleTouchStart(ev));
|
||||||
this.rmMouseStart = listenEvent(ele, 'mousedown', zone, option, (ev: any) => this.handleMouseDown(ev));
|
this.rmMouseStart = listenEvent(ele, 'mousedown', zone, option, (ev: any) => this.handleMouseDown(ev));
|
||||||
}
|
}
|
||||||
@ -92,19 +92,19 @@ export class PointerEvents {
|
|||||||
destroy() {
|
destroy() {
|
||||||
this.rmTouchStart && this.rmTouchStart();
|
this.rmTouchStart && this.rmTouchStart();
|
||||||
this.rmTouchStart = null;
|
this.rmTouchStart = null;
|
||||||
|
|
||||||
this.rmMouseStart && this.rmMouseStart();
|
this.rmMouseStart && this.rmMouseStart();
|
||||||
this.rmMouseStart = null;
|
this.rmMouseStart = null;
|
||||||
|
|
||||||
this.stop();
|
this.stop();
|
||||||
|
|
||||||
this.pointerDown = null;
|
this.pointerDown = null;
|
||||||
this.pointerMove = null;
|
this.pointerMove = null;
|
||||||
this.pointerUp = null;
|
this.pointerUp = null;
|
||||||
|
|
||||||
this.ele = null;
|
this.ele = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -119,8 +119,8 @@ export class UIEventManager {
|
|||||||
listenRef(ref: ElementRef, eventName: string, callback: any, option?: any): Function {
|
listenRef(ref: ElementRef, eventName: string, callback: any, option?: any): Function {
|
||||||
return this.listen(ref.nativeElement, eventName, callback, option);
|
return this.listen(ref.nativeElement, eventName, callback, option);
|
||||||
}
|
}
|
||||||
|
|
||||||
pointerEventsRef(ref: ElementRef, pointerStart: any, pointerMove: any, pointerEnd: any, option?: any): Function {
|
pointerEventsRef(ref: ElementRef, pointerStart: any, pointerMove: any, pointerEnd: any, option?: any): PointerEvents {
|
||||||
return this.pointerEvents(ref.nativeElement, pointerStart, pointerMove, pointerEnd, option);
|
return this.pointerEvents(ref.nativeElement, pointerStart, pointerMove, pointerEnd, option);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ export class UIEventManager {
|
|||||||
pointerUp,
|
pointerUp,
|
||||||
this.zoneWrapped,
|
this.zoneWrapped,
|
||||||
option);
|
option);
|
||||||
|
|
||||||
let removeFunc = () => submanager.destroy();
|
let removeFunc = () => submanager.destroy();
|
||||||
this.events.push(removeFunc);
|
this.events.push(removeFunc);
|
||||||
return submanager;
|
return submanager;
|
||||||
@ -155,7 +155,7 @@ export class UIEventManager {
|
|||||||
event();
|
event();
|
||||||
}
|
}
|
||||||
this.events.length = 0;
|
this.events.length = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function listenEvent(ele: any, eventName: string, zoneWrapped: boolean, option: any, callback: any): Function {
|
function listenEvent(ele: any, eventName: string, zoneWrapped: boolean, option: any, callback: any): Function {
|
||||||
|
Reference in New Issue
Block a user