fix(frame): root tabview with modal frame when suspend/resume app (#5408)

This commit is contained in:
Manol Donev
2018-02-12 16:09:51 +02:00
committed by GitHub
parent b113b0021a
commit 2edef3de3b
7 changed files with 38 additions and 13 deletions

View File

@@ -263,6 +263,10 @@ export abstract class ViewBase extends Observable {
*/
public _removeViewCore(view: ViewBase): void;
public _parentChanged(oldParent: ViewBase): void;
/**
* Method is intended to be overridden by inheritors and used as "protected"
*/
public _dialogClosed(): void;
_domId: number;

View File

@@ -956,6 +956,10 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
parent.closeModal();
}
}
public _dialogClosed(): void {
return;
}
}
ViewBase.prototype.isCollapsed = false;

View File

@@ -251,10 +251,12 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
const modalIndex = _rootModalViews.indexOf(that);
_rootModalViews.splice(modalIndex);
that._hideNativeModalView(parent);
that._modalParent = null
that._modalParent = null;
that._modalContext = null;
that._closeModalCallback = null;
that._dialogClosed();
parent._modal = null;
if (typeof closeCallback === "function") {
closeCallback.apply(undefined, arguments);
}

View File

@@ -58,18 +58,10 @@ export class FrameBase extends CustomLayoutView implements FrameDefinition {
@profile
public onLoaded() {
super.onLoaded();
this._pushInFrameStack();
this._processNextNavigationEntry();
}
@profile
public onUnloaded() {
super.onUnloaded();
this._popFromFrameStack();
}
public canGoBack(): boolean {
let backstack = this._backStack.length;
let previousForwardNotInBackstack = false;
@@ -192,6 +184,8 @@ export class FrameBase extends CustomLayoutView implements FrameDefinition {
// app.on(app.orientationChangedEvent, (data) => this._onOrientationChanged());
// }
this._pushInFrameStack();
const backstackEntry: BackstackEntry = {
entry: entry,
resolvedPage: page,
@@ -430,6 +424,10 @@ export class FrameBase extends CustomLayoutView implements FrameDefinition {
this._isInFrameStack = false;
}
public _dialogClosed(): void {
this._popFromFrameStack();
}
get _childrenCount(): number {
if (this.currentPage) {
return 1;

View File

@@ -243,7 +243,9 @@ export class Frame extends FrameBase {
if (this.canGoBack()) {
this.goBack();
return true;
} else if (!this.navigationQueueIsEmpty()) {
}
if (!this.navigationQueueIsEmpty()) {
const manager = this._getFragmentManager();
if (manager) {
manager.executePendingTransactions();