Don't apply default values on syncNative

This commit is contained in:
vakrilov
2015-10-19 17:29:51 +03:00
parent e8332854f7
commit c9744b7474
2 changed files with 6 additions and 1 deletions

View File

@@ -249,6 +249,10 @@ export class View extends viewCommon.View {
trace.write("calling _onContextChanged on view " + this._domId, trace.categories.VisualTreeEvents);
this._createUI();
// Ensure layout params
if (this._nativeView && !(this._nativeView.getLayoutParams() instanceof org.nativescript.widgets.CommonLayoutParams)) {
this._nativeView.setLayoutParams(new org.nativescript.widgets.CommonLayoutParams());
}
utils.copyFrom(this._options, this);
delete this._options;

View File

@@ -593,7 +593,8 @@ export class Style extends DependencyObservable implements styling.Style {
// TODO: Potential performance bottle-neck
styleProperty.eachProperty(function (p: styleProperty.Property) {
var value = that._getValue(p);
if (types.isDefined(value)) {
var valueSource = that._getValueSource(p);
if (valueSource !== ValueSource.Default && types.isDefined(value)) {
that._applyProperty(p, value);
}
});