MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / butonTap

Function butonTap

apps/ui/src/css/white-space-page.ts:8–26  ·  view source on GitHub ↗
(args: observable.EventData)

Source from the content-addressed store, hash-verified

6import * as textView from '@nativescript/core/ui/text-view';
7
8export function butonTap(args: observable.EventData) {
9 var btnChange = <view.View>args.object;
10 var lbl = <label.Label>btnChange.parent.getViewById('Label');
11 var btn = <button.Button>btnChange.parent.getViewById('Button');
12 var textField = <textField.TextField>btnChange.parent.getViewById('TextField');
13 var textView = <textView.TextView>btnChange.parent.getViewById('TextView');
14
15 if (lbl.style.whiteSpace === 'normal') {
16 lbl.style.whiteSpace = 'nowrap';
17 btn.style.whiteSpace = 'nowrap';
18 textField.style.whiteSpace = 'nowrap';
19 textView.style.whiteSpace = 'nowrap';
20 } else if (lbl.style.whiteSpace === 'nowrap') {
21 lbl.style.whiteSpace = 'normal';
22 btn.style.whiteSpace = 'normal';
23 textField.style.whiteSpace = 'normal';
24 textView.style.whiteSpace = 'normal';
25 }
26}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected