Fix Repeater

This commit is contained in:
Rossen Hristov
2016-12-27 16:00:49 +02:00
parent 228b914162
commit f7c9dc2adc
2 changed files with 7 additions and 7 deletions

View File

@@ -546,7 +546,7 @@ export class CssProperty<T extends Style, U> {
}
export class InheritedCssProperty<T extends Style, U> extends CssProperty<T, U> {
public setInhertiedValue: (value: U) => void;
public setInheritedValue: (value: U) => void;
constructor(options: CssPropertyOptions<T, U>) {
super(options);
@@ -662,7 +662,7 @@ export class InheritedCssProperty<T extends Style, U> extends CssProperty<T, U>
const setDefaultFunc = setFunc(ValueSource.Default);
const setInheritedFunc = setFunc(ValueSource.Inherited);
this.setInhertiedValue = setInheritedFunc;
this.setInheritedValue = setInheritedFunc;
this.cssValueDescriptor.set = setFunc(ValueSource.Css);
this.localValueDescriptor.set = setFunc(ValueSource.Local);
@@ -829,7 +829,7 @@ export function clearInheritedProperties(view: ViewBase): void {
for (let prop of inheritableCssProperties) {
const sourceKey = prop.sourceKey;
if (style[sourceKey] === ValueSource.Inherited) {
prop.setInhertiedValue.call(style, unsetValue);
prop.setInheritedValue.call(style, unsetValue);
}
}
}
@@ -878,7 +878,7 @@ export function propagateInheritedProperties(view: ViewBase): void {
const style = child.style;
const currentValueSource: number = style[sourceKey] || ValueSource.Default;
if (currentValueSource <= ValueSource.Inherited) {
prop.setInhertiedValue.call(style, pair.value, ValueSource.Inherited);
prop.setInheritedValue.call(style, pair.value, ValueSource.Inherited);
}
return true;
}

View File

@@ -150,15 +150,15 @@ itemsProperty.register(Repeater);
export const itemsLayoutProperty = new Property<Repeater, LayoutBase>({
name: "itemsLayout", affectsLayout: true, valueChanged: (target, oldValue, newValue) => {
if (oldValue) {
this._removeView(oldValue);
target._removeView(oldValue);
oldValue.removeChildren();
}
if (newValue) {
this._addView(newValue);
target._addView(newValue);
}
this._requestRefresh();
target._requestRefresh();
}
});
itemsLayoutProperty.register(Repeater);