mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
* chore(tslint): fix tslint config & errors * chore(tslint): enable double quotes, whitespace, and arrow-return-shorthand rules and fix errors
26 lines
1.0 KiB
TypeScript
26 lines
1.0 KiB
TypeScript
import { EventData } from "tns-core-modules/data/observable";
|
|
import { Page } from "tns-core-modules/ui/page";
|
|
import { Button } from "tns-core-modules/ui/button";
|
|
import { Label } from "tns-core-modules/ui/label";
|
|
import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout";
|
|
import { GridLayout } from "tns-core-modules/ui/layouts/grid-layout";
|
|
|
|
export function toggle(args: EventData) {
|
|
const page = <Page>((<any>args.object).page);
|
|
|
|
const getElementById = id => page.getViewById(id)
|
|
|
|
const toggleBtn = <Button>getElementById("toggleUserInteraction");
|
|
const isEnabled = toggleBtn.text === "disable" ? true : false;
|
|
toggleBtn.text = !isEnabled ? "disable" : "enable";
|
|
|
|
(<Button>getElementById("testBtn")).isUserInteractionEnabled = !isEnabled;
|
|
(<Button>getElementById("testLabel")).isUserInteractionEnabled = !isEnabled;
|
|
(<StackLayout>getElementById("testStackLayout")).isUserInteractionEnabled = !isEnabled;
|
|
}
|
|
|
|
export function test() {
|
|
console.log("onTap");
|
|
alert("onTap");
|
|
}
|