mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
Remove the _originalBindingContext caching
This commit is contained in:
@ -9,6 +9,7 @@ import * as fileSystemModule from "file-system";
|
|||||||
import * as frameModule from "ui/frame";
|
import * as frameModule from "ui/frame";
|
||||||
import proxy = require("ui/core/proxy");
|
import proxy = require("ui/core/proxy");
|
||||||
import keyframeAnimation = require("ui/animation/keyframe-animation");
|
import keyframeAnimation = require("ui/animation/keyframe-animation");
|
||||||
|
import types = require("utils/types");
|
||||||
|
|
||||||
let fs: typeof fileSystemModule;
|
let fs: typeof fileSystemModule;
|
||||||
function ensureFS() {
|
function ensureFS() {
|
||||||
@ -199,13 +200,11 @@ export class Page extends ContentView implements dts.Page {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private _originalBindingContext: any;
|
|
||||||
public onNavigatingTo(context: any, isBackNavigation: boolean) {
|
public onNavigatingTo(context: any, isBackNavigation: boolean) {
|
||||||
this._navigationContext = context;
|
this._navigationContext = context;
|
||||||
|
|
||||||
//https://github.com/NativeScript/NativeScript/issues/731
|
//https://github.com/NativeScript/NativeScript/issues/731
|
||||||
if (!isBackNavigation && context && this.bindingContext !== context){
|
if (!isBackNavigation && !types.isNullOrUndefined(context)){
|
||||||
this._originalBindingContext = this.bindingContext;
|
|
||||||
this.bindingContext = context;
|
this.bindingContext = context;
|
||||||
}
|
}
|
||||||
this.notify(this.createNavigatedData(Page.navigatingToEvent, isBackNavigation));
|
this.notify(this.createNavigatedData(Page.navigatingToEvent, isBackNavigation));
|
||||||
@ -223,12 +222,6 @@ export class Page extends ContentView implements dts.Page {
|
|||||||
this.notify(this.createNavigatedData(Page.navigatedFromEvent, isBackNavigation));
|
this.notify(this.createNavigatedData(Page.navigatedFromEvent, isBackNavigation));
|
||||||
|
|
||||||
this._navigationContext = undefined;
|
this._navigationContext = undefined;
|
||||||
|
|
||||||
//https://github.com/NativeScript/NativeScript/issues/731
|
|
||||||
if (isBackNavigation && this._originalBindingContext && this.bindingContext !== this._originalBindingContext){
|
|
||||||
this.bindingContext = this._originalBindingContext;
|
|
||||||
this._originalBindingContext = undefined;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public showModal(): Page {
|
public showModal(): Page {
|
||||||
|
Reference in New Issue
Block a user