Fix all property types

This commit is contained in:
Rossen Hristov
2017-01-04 10:20:33 +02:00
parent cce0a2d42f
commit da0df29d20
2 changed files with 4 additions and 5 deletions

View File

@@ -1767,16 +1767,15 @@ export const borderLeftWidthProperty = new CssProperty<Style, Length>({
borderLeftWidthProperty.register(Style); borderLeftWidthProperty.register(Style);
// Border Radius properties. // Border Radius properties.
const borderRadiusProperty = new ShorthandProperty<Style, number>({ const borderRadiusProperty = new ShorthandProperty<Style, string | number>({
name: "borderRadius", cssName: "border-radius", name: "borderRadius", cssName: "border-radius",
getter: function (this: Style) { getter: function (this: Style) {
if (this.borderTopLeftRadius === this.borderTopRightRadius && if (this.borderTopLeftRadius === this.borderTopRightRadius &&
this.borderTopLeftRadius === this.borderBottomRightRadius && this.borderTopLeftRadius === this.borderBottomRightRadius &&
this.borderTopLeftRadius === this.borderBottomLeftRadius) { this.borderTopLeftRadius === this.borderBottomLeftRadius) {
return this.borderTopLeftRadius + ""; return this.borderTopLeftRadius;
} else {
return `${this.borderTopLeftRadius} ${this.borderTopRightRadius} ${this.borderBottomRightRadius} ${this.borderBottomLeftRadius}`;
} }
return `${this.borderTopLeftRadius} ${this.borderTopRightRadius} ${this.borderBottomRightRadius} ${this.borderBottomLeftRadius}`;
}, },
converter: function (value) { converter: function (value) {
if (typeof value === "string"){ if (typeof value === "string"){

View File

@@ -722,7 +722,7 @@ declare module "ui/core/view" {
export const borderBottomWidthProperty: CssProperty<Style, Length>; export const borderBottomWidthProperty: CssProperty<Style, Length>;
export const borderLeftWidthProperty: CssProperty<Style, Length>; export const borderLeftWidthProperty: CssProperty<Style, Length>;
export const borderRadiusProperty: CssProperty<Style, number>; export const borderRadiusProperty: ShorthandProperty<Style, string | number>;
export const borderTopLeftRadiusProperty: CssProperty<Style, number>; export const borderTopLeftRadiusProperty: CssProperty<Style, number>;
export const borderTopRightRadiusProperty: CssProperty<Style, number>; export const borderTopRightRadiusProperty: CssProperty<Style, number>;
export const borderBottomRightRadiusProperty: CssProperty<Style, number>; export const borderBottomRightRadiusProperty: CssProperty<Style, number>;