opt:when subview is reused, transfer its property totally
This commit is contained in:
parent
07a958c3bd
commit
92b106d11f
@ -599,6 +599,14 @@ var Superview = /** @class */ (function (_super) {
|
|||||||
for (var _b = __values$5(this.allSubviews()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
for (var _b = __values$5(this.allSubviews()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||||
var v = _c.value;
|
var v = _c.value;
|
||||||
if (v != undefined) {
|
if (v != undefined) {
|
||||||
|
if (v.superview && v.superview !== this) {
|
||||||
|
//It had been added to another view, need to be marked totally
|
||||||
|
for (var key in v) {
|
||||||
|
if (key.startsWith("__prop__")) {
|
||||||
|
v.onPropertyChanged(key, undefined, Reflect.get(v, key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
v.superview = this;
|
v.superview = this;
|
||||||
if (v.isDirty()) {
|
if (v.isDirty()) {
|
||||||
subviews.push(v.toModel());
|
subviews.push(v.toModel());
|
||||||
|
@ -486,6 +486,14 @@ class Superview extends View {
|
|||||||
const subviews = [];
|
const subviews = [];
|
||||||
for (let v of this.allSubviews()) {
|
for (let v of this.allSubviews()) {
|
||||||
if (v != undefined) {
|
if (v != undefined) {
|
||||||
|
if (v.superview && v.superview !== this) {
|
||||||
|
//It had been added to another view, need to be marked totally
|
||||||
|
for (let key in v) {
|
||||||
|
if (Reflect.getMetadata(key, v) === PROP_CONSIST || Reflect.getMetadata(key, v) === PROP_INCONSIST) {
|
||||||
|
v.onPropertyChanged(key, undefined, Reflect.get(v, key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
v.superview = this;
|
v.superview = this;
|
||||||
if (v.isDirty()) {
|
if (v.isDirty()) {
|
||||||
subviews.push(v.toModel());
|
subviews.push(v.toModel());
|
||||||
|
@ -2007,6 +2007,14 @@ class Superview extends View {
|
|||||||
const subviews = [];
|
const subviews = [];
|
||||||
for (let v of this.allSubviews()) {
|
for (let v of this.allSubviews()) {
|
||||||
if (v != undefined) {
|
if (v != undefined) {
|
||||||
|
if (v.superview && v.superview !== this) {
|
||||||
|
//It had been added to another view, need to be marked totally
|
||||||
|
for (let key in v) {
|
||||||
|
if (Reflect.getMetadata(key, v) === PROP_CONSIST || Reflect.getMetadata(key, v) === PROP_INCONSIST) {
|
||||||
|
v.onPropertyChanged(key, undefined, Reflect.get(v, key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
v.superview = this;
|
v.superview = this;
|
||||||
if (v.isDirty()) {
|
if (v.isDirty()) {
|
||||||
subviews.push(v.toModel());
|
subviews.push(v.toModel());
|
||||||
|
@ -368,6 +368,14 @@ export class Superview extends View {
|
|||||||
const subviews = [];
|
const subviews = [];
|
||||||
for (let v of this.allSubviews()) {
|
for (let v of this.allSubviews()) {
|
||||||
if (v != undefined) {
|
if (v != undefined) {
|
||||||
|
if (v.superview && v.superview !== this) {
|
||||||
|
//It had been added to another view, need to be marked totally
|
||||||
|
for (let key in v) {
|
||||||
|
if (Reflect.getMetadata(key, v) === PROP_CONSIST || Reflect.getMetadata(key, v) === PROP_INCONSIST) {
|
||||||
|
v.onPropertyChanged(key, undefined, Reflect.get(v, key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
v.superview = this;
|
v.superview = this;
|
||||||
if (v.isDirty()) {
|
if (v.isDirty()) {
|
||||||
subviews.push(v.toModel());
|
subviews.push(v.toModel());
|
||||||
|
@ -408,6 +408,14 @@ export abstract class Superview extends View {
|
|||||||
const subviews = []
|
const subviews = []
|
||||||
for (let v of this.allSubviews()) {
|
for (let v of this.allSubviews()) {
|
||||||
if (v != undefined) {
|
if (v != undefined) {
|
||||||
|
if (v.superview && v.superview !== this) {
|
||||||
|
//It had been added to another view, need to be marked totally
|
||||||
|
for (let key in v) {
|
||||||
|
if (key.startsWith("__prop__")) {
|
||||||
|
v.onPropertyChanged(key, undefined, Reflect.get(v, key))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
v.superview = this
|
v.superview = this
|
||||||
if (v.isDirty()) {
|
if (v.isDirty()) {
|
||||||
subviews.push(v.toModel())
|
subviews.push(v.toModel())
|
||||||
|
@ -434,6 +434,14 @@ export abstract class Superview extends View {
|
|||||||
const subviews = []
|
const subviews = []
|
||||||
for (let v of this.allSubviews()) {
|
for (let v of this.allSubviews()) {
|
||||||
if (v != undefined) {
|
if (v != undefined) {
|
||||||
|
if (v.superview && v.superview !== this) {
|
||||||
|
//It had been added to another view, need to be marked totally
|
||||||
|
for (let key in v) {
|
||||||
|
if (Reflect.getMetadata(key, v) === PROP_CONSIST || Reflect.getMetadata(key, v) === PROP_INCONSIST) {
|
||||||
|
v.onPropertyChanged(key, undefined, Reflect.get(v, key))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
v.superview = this
|
v.superview = this
|
||||||
if (v.isDirty()) {
|
if (v.isDirty()) {
|
||||||
subviews.push(v.toModel())
|
subviews.push(v.toModel())
|
||||||
|
8
doric-web/dist/index.js
vendored
8
doric-web/dist/index.js
vendored
@ -2061,6 +2061,14 @@ class Superview extends View {
|
|||||||
const subviews = [];
|
const subviews = [];
|
||||||
for (let v of this.allSubviews()) {
|
for (let v of this.allSubviews()) {
|
||||||
if (v != undefined) {
|
if (v != undefined) {
|
||||||
|
if (v.superview && v.superview !== this) {
|
||||||
|
//It had been added to another view, need to be marked totally
|
||||||
|
for (let key in v) {
|
||||||
|
if (Reflect.getMetadata(key, v) === PROP_CONSIST || Reflect.getMetadata(key, v) === PROP_INCONSIST) {
|
||||||
|
v.onPropertyChanged(key, undefined, Reflect.get(v, key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
v.superview = this;
|
v.superview = this;
|
||||||
if (v.isDirty()) {
|
if (v.isDirty()) {
|
||||||
subviews.push(v.toModel());
|
subviews.push(v.toModel());
|
||||||
|
2
doric-web/dist/index.js.map
vendored
2
doric-web/dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user