Files
NativeScript/tests/app/ui/page/modal-page.ts
Manol Donev 03cfc0cee3 chore(tslint): update tslint rules and fix errors (#5747)
* chore(tslint): fix tslint config & errors
* chore(tslint): enable double quotes, whitespace, and arrow-return-shorthand rules and fix errors
2018-04-26 18:36:32 +03:00

21 lines
717 B
TypeScript

import { topmost } from "tns-core-modules/ui/frame";
import * as TKUnit from "../../TKUnit";
import { Page, ShownModallyData } from "tns-core-modules/ui/page";
export var modalPage: Page;
export function onShowingModally(args) {
modalPage = <Page>args.object;
args.object.showingModally = true;
}
export function onShownModally(args: ShownModallyData) {
let page = <Page>args.object;
TKUnit.assertNotNull(page);
if (args.context) {
args.context.shownModally = true;
}
TKUnit.assertEqual(topmost().currentPage.modal, page, "frame.topmost().currentPage.modal should be equal to the page instance on page.shownModally event handler.");
args.closeCallback("return value");
}