mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
Merge pull request #1152 from NativeScript/nnikolov/smallFixes
Added some checks for binding infrastructure.
This commit is contained in:
@ -258,9 +258,9 @@ export class Binding {
|
|||||||
}
|
}
|
||||||
result.push({ instance: currentObject, property: objProp });
|
result.push({ instance: currentObject, property: objProp });
|
||||||
if (!currentObjectChanged) {
|
if (!currentObjectChanged) {
|
||||||
currentObject = currentObject[propsArray[i]];
|
currentObject = currentObject ? currentObject[propsArray[i]] : null;
|
||||||
currentObjectChanged = false;
|
|
||||||
}
|
}
|
||||||
|
currentObjectChanged = false;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -273,7 +273,7 @@ export class Binding {
|
|||||||
for (i = 0; i < objectsAndPropertiesLength; i++) {
|
for (i = 0; i < objectsAndPropertiesLength; i++) {
|
||||||
var prop = objectsAndProperties[i].property;
|
var prop = objectsAndProperties[i].property;
|
||||||
var currentObject = objectsAndProperties[i].instance;
|
var currentObject = objectsAndProperties[i].instance;
|
||||||
if (!this.propertyChangeListeners[prop] && currentObject instanceof observable.Observable) {
|
if (currentObject && !this.propertyChangeListeners[prop] && currentObject instanceof observable.Observable) {
|
||||||
weakEvents.addWeakEventListener(
|
weakEvents.addWeakEventListener(
|
||||||
currentObject,
|
currentObject,
|
||||||
observable.Observable.propertyChangeEvent,
|
observable.Observable.propertyChangeEvent,
|
||||||
@ -563,14 +563,14 @@ export class Binding {
|
|||||||
if (objectsAndProperties.length > 0) {
|
if (objectsAndProperties.length > 0) {
|
||||||
var resolvedObj = objectsAndProperties[objectsAndProperties.length - 1].instance;
|
var resolvedObj = objectsAndProperties[objectsAndProperties.length - 1].instance;
|
||||||
var prop = objectsAndProperties[objectsAndProperties.length - 1].property;
|
var prop = objectsAndProperties[objectsAndProperties.length - 1].property;
|
||||||
return {
|
if (resolvedObj) {
|
||||||
instance: new WeakRef(resolvedObj),
|
return {
|
||||||
property: prop
|
instance: new WeakRef(resolvedObj),
|
||||||
|
property: prop
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
return null;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateOptions(options: { instance: WeakRef<any>; property: any }, value: any) {
|
private updateOptions(options: { instance: WeakRef<any>; property: any }, value: any) {
|
||||||
|
@ -206,6 +206,7 @@ export class ListView extends common.ListView {
|
|||||||
this._ios.registerClassForCellReuseIdentifier(ListViewCell.class(), CELLIDENTIFIER);
|
this._ios.registerClassForCellReuseIdentifier(ListViewCell.class(), CELLIDENTIFIER);
|
||||||
this._ios.autoresizingMask = UIViewAutoresizing.UIViewAutoresizingNone;
|
this._ios.autoresizingMask = UIViewAutoresizing.UIViewAutoresizingNone;
|
||||||
this._ios.estimatedRowHeight = DEFAULT_HEIGHT;
|
this._ios.estimatedRowHeight = DEFAULT_HEIGHT;
|
||||||
|
this._ios.rowHeight = UITableViewAutomaticDimension;
|
||||||
this._ios.dataSource = this._dataSource = DataSource.initWithOwner(new WeakRef(this));
|
this._ios.dataSource = this._dataSource = DataSource.initWithOwner(new WeakRef(this));
|
||||||
this._delegate = UITableViewDelegateImpl.initWithOwner(new WeakRef(this));
|
this._delegate = UITableViewDelegateImpl.initWithOwner(new WeakRef(this));
|
||||||
this._heights = new Array<number>();
|
this._heights = new Array<number>();
|
||||||
|
Reference in New Issue
Block a user