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

Function butonTap

apps/ui/src/css/text-decoration-page.ts:5–26  ·  view source on GitHub ↗
(args: EventData)

Source from the content-addressed store, hash-verified

3const possibleValues = ['none', 'underline', 'line-through', 'underline line-through'];
4
5export function butonTap(args: EventData) {
6 let page = (<TextBase>args.object).page;
7 let lbl = <TextBase>page.getViewById('Label');
8 let btn = <TextBase>page.getViewById('Button');
9 let textField = <TextBase>page.getViewById('TextField');
10 let textView = <TextBase>page.getViewById('TextView');
11
12 let currentIndex = possibleValues.indexOf(lbl.textDecoration);
13 let newIndex = (currentIndex + 1) % possibleValues.length;
14 let newValue = <any>possibleValues[newIndex];
15
16 lbl.textDecoration = newValue;
17 btn.textDecoration = newValue;
18 textField.textDecoration = newValue;
19 textView.textDecoration = newValue;
20
21 if (lbl.text === 'Change text') {
22 lbl.text = btn.text = textField.text = textView.text = 'Text changed';
23 } else {
24 lbl.text = btn.text = textField.text = textView.text = 'Change text';
25 }
26}

Callers

nothing calls this directly

Calls 1

indexOfMethod · 0.80

Tested by

no test coverage detected