mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
24 lines
546 B
TypeScript
24 lines
546 B
TypeScript
import { Page, ShownModallyData, Observable } from '@nativescript/core';
|
|
|
|
let page: Page;
|
|
let closeCallback: Function;
|
|
export function onShownModally(args: ShownModallyData) {
|
|
page = <Page>args.object;
|
|
page.bindingContext = new SampleModal();
|
|
closeCallback = args.closeCallback;
|
|
|
|
if (args.context) {
|
|
args.context.shownModally = true;
|
|
}
|
|
}
|
|
|
|
export class SampleModal extends Observable {
|
|
close() {
|
|
// TODO: a11y
|
|
// if (global.isIOS) {
|
|
// (<UIViewController>page.ios).view.accessibilityPerformEscape();
|
|
// }
|
|
closeCallback();
|
|
}
|
|
}
|