Files
NativeScript/nativescript-core/ui/button/button-common.ts
Nathan Walker da3c0b973d chore: format
2020-07-11 11:01:40 -07:00

23 lines
610 B
TypeScript

import { Button as ButtonDefinition } from ".";
import { TextBase } from "../text-base";
import { CSSType } from "../core/view";
import { booleanConverter } from "../core/view-base";
@CSSType("Button")
export abstract class ButtonBase extends TextBase implements ButtonDefinition {
public static tapEvent = "tap";
get textWrap(): boolean {
return this.style.whiteSpace === "normal";
}
set textWrap(value: boolean) {
if (typeof value === "string") {
value = booleanConverter(value);
}
this.style.whiteSpace = value ? "normal" : "nowrap";
}
}
ButtonBase.prototype.recycleNativeView = "auto";