mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
@ -183,6 +183,7 @@ export class ActionSheetCmp {
|
|||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
assert(this.gestureBlocker.blocked === false, 'gesture blocker must be already unblocked');
|
assert(this.gestureBlocker.blocked === false, 'gesture blocker must be already unblocked');
|
||||||
|
this.d = null;
|
||||||
this.gestureBlocker.destroy();
|
this.gestureBlocker.destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -516,7 +516,7 @@ export class Menu {
|
|||||||
this.isOpen = isOpen;
|
this.isOpen = isOpen;
|
||||||
this._isAnimating = false;
|
this._isAnimating = false;
|
||||||
|
|
||||||
this._events.destroy();
|
this._events.unlistenAll();
|
||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
// Disable swipe to go back gesture
|
// Disable swipe to go back gesture
|
||||||
this._gestureBlocker.block();
|
this._gestureBlocker.block();
|
||||||
|
@ -503,6 +503,7 @@ export class Refresher {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
|
this._events.destroy();
|
||||||
this._gesture.destroy();
|
this._gesture.destroy();
|
||||||
this._setListeners(false);
|
this._setListeners(false);
|
||||||
}
|
}
|
||||||
|
@ -411,6 +411,7 @@ export class Tabs extends Ion implements AfterViewInit {
|
|||||||
if (opts.updateUrl !== false) {
|
if (opts.updateUrl !== false) {
|
||||||
this._linker.navChange(DIRECTION_SWITCH);
|
this._linker.navChange(DIRECTION_SWITCH);
|
||||||
}
|
}
|
||||||
|
assert(this.getSelected() === selectedTab, 'selected tab does not match');
|
||||||
this._fireChangeEvent(selectedTab);
|
this._fireChangeEvent(selectedTab);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -419,8 +420,6 @@ export class Tabs extends Ion implements AfterViewInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_fireChangeEvent(selectedTab: Tab) {
|
_fireChangeEvent(selectedTab: Tab) {
|
||||||
assert(this.getSelected() === selectedTab, 'selected tab does not match');
|
|
||||||
|
|
||||||
selectedTab.ionSelect.emit(selectedTab);
|
selectedTab.ionSelect.emit(selectedTab);
|
||||||
this.ionChange.emit(selectedTab);
|
this.ionChange.emit(selectedTab);
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ export class PanGesture {
|
|||||||
unlisten() {
|
unlisten() {
|
||||||
if (this.isListening) {
|
if (this.isListening) {
|
||||||
this.gestute && this.gestute.release();
|
this.gestute && this.gestute.release();
|
||||||
this.events.destroy();
|
this.events.unlistenAll();
|
||||||
this.isListening = false;
|
this.isListening = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -71,7 +71,8 @@ export class PanGesture {
|
|||||||
this.gestute && this.gestute.destroy();
|
this.gestute && this.gestute.destroy();
|
||||||
this.gestute = null;
|
this.gestute = null;
|
||||||
this.unlisten();
|
this.unlisten();
|
||||||
this.element = null;
|
this.events.destroy();
|
||||||
|
this.events = this.element = this.gestute = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
pointerDown(ev: any): boolean {
|
pointerDown(ev: any): boolean {
|
||||||
|
@ -43,10 +43,15 @@ export class UIEventManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
unlistenAll() {
|
||||||
this.evts.forEach(unRegEvent => {
|
this.evts.forEach(unRegEvent => {
|
||||||
unRegEvent();
|
unRegEvent();
|
||||||
});
|
});
|
||||||
this.evts.length = 0;
|
this.evts.length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
destroy() {
|
||||||
|
this.unlistenAll();
|
||||||
|
this.evts = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -723,7 +723,7 @@ export class NavControllerBase extends Ion implements NavController {
|
|||||||
|
|
||||||
if (transition.isRoot()) {
|
if (transition.isRoot()) {
|
||||||
// this is the root transition
|
// this is the root transition
|
||||||
// it's save to destroy this transition
|
// it's safe to destroy this transition
|
||||||
this._trnsCtrl.destroy(transition.trnsId);
|
this._trnsCtrl.destroy(transition.trnsId);
|
||||||
|
|
||||||
// it's safe to enable the app again
|
// it's safe to enable the app again
|
||||||
@ -909,13 +909,10 @@ export class NavControllerBase extends Ion implements NavController {
|
|||||||
view._destroy(this._renderer);
|
view._destroy(this._renderer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// purge stack
|
|
||||||
this._views.length = 0;
|
|
||||||
|
|
||||||
// release swipe back gesture and transition
|
// release swipe back gesture and transition
|
||||||
this._sbGesture && this._sbGesture.destroy();
|
this._sbGesture && this._sbGesture.destroy();
|
||||||
this._sbTrns && this._sbTrns.destroy();
|
this._sbTrns && this._sbTrns.destroy();
|
||||||
this._sbGesture = this._sbTrns = null;
|
this._queue = this._views = this._sbGesture = this._sbTrns = null;
|
||||||
|
|
||||||
// Unregister navcontroller
|
// Unregister navcontroller
|
||||||
if (this.parent && this.parent.unregisterChildNav) {
|
if (this.parent && this.parent.unregisterChildNav) {
|
||||||
|
@ -523,7 +523,7 @@ export class ViewController {
|
|||||||
this._cmp.destroy();
|
this._cmp.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
this._nav = this._cmp = this.instance = this._cntDir = this._cntRef = this._hdrDir = this._ftrDir = this._nb = this._onDidDismiss = this._onWillDismiss = null;
|
this._nav = this._cmp = this.instance = this._cntDir = this._cntRef = this._leavingOpts = this._hdrDir = this._ftrDir = this._nb = this._onDidDismiss = this._onWillDismiss = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,8 +10,6 @@ import { DomController } from '../platform/dom-controller';
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
export class RippleActivator implements ActivatorBase {
|
export class RippleActivator implements ActivatorBase {
|
||||||
protected _queue: HTMLElement[] = [];
|
|
||||||
protected _active: HTMLElement[] = [];
|
|
||||||
protected highlight: Activator;
|
protected highlight: Activator;
|
||||||
|
|
||||||
constructor(app: App, config: Config, private dom: DomController) {
|
constructor(app: App, config: Config, private dom: DomController) {
|
||||||
@ -52,8 +50,6 @@ export class RippleActivator implements ActivatorBase {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._active.push(activatableEle);
|
|
||||||
|
|
||||||
var j = activatableEle.childElementCount;
|
var j = activatableEle.childElementCount;
|
||||||
while (j--) {
|
while (j--) {
|
||||||
var rippleEle: any = activatableEle.children[j];
|
var rippleEle: any = activatableEle.children[j];
|
||||||
|
@ -221,11 +221,13 @@ export class TapClick {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getActivatableTarget(ele: HTMLElement) {
|
function getActivatableTarget(ele: HTMLElement): any {
|
||||||
let targetEle = ele;
|
let targetEle = ele;
|
||||||
for (let x = 0; x < 10; x++) {
|
for (let x = 0; x < 10; x++) {
|
||||||
if (!targetEle) break;
|
if (!targetEle) break;
|
||||||
if (isActivatable(targetEle)) return targetEle;
|
if (isActivatable(targetEle)) {
|
||||||
|
return targetEle;
|
||||||
|
}
|
||||||
targetEle = targetEle.parentElement;
|
targetEle = targetEle.parentElement;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -25,6 +25,7 @@ export class PageTransition extends Transition {
|
|||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
super.destroy();
|
super.destroy();
|
||||||
|
this.enteringPage && this.enteringPage.destroy();
|
||||||
this.enteringPage = null;
|
this.enteringPage = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,8 +53,9 @@ export class TransitionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
destroy(trnsId: number) {
|
destroy(trnsId: number) {
|
||||||
if (this._trns[trnsId]) {
|
const trans = this._trns[trnsId];
|
||||||
this._trns[trnsId].destroy();
|
if (trans) {
|
||||||
|
trans.destroy();
|
||||||
delete this._trns[trnsId];
|
delete this._trns[trnsId];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ export class Transition extends Animation {
|
|||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
super.destroy();
|
super.destroy();
|
||||||
this.enteringView = this.leavingView = this._trnsStart = null;
|
this.parent = this.enteringView = this.leavingView = this._trnsStart = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user