mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
added simple showModal() overload
This commit is contained in:
@ -197,9 +197,18 @@ export class Page extends ContentView implements dts.Page {
|
||||
this._navigationContext = undefined;
|
||||
}
|
||||
|
||||
public showModal(moduleName: string, context: any, closeCallback: Function, fullscreen?: boolean) {
|
||||
var page = frameCommon.resolvePageFromEntry({ moduleName: moduleName });
|
||||
(<Page>page)._showNativeModalView(this, context, closeCallback, fullscreen);
|
||||
public showModal() {
|
||||
if (arguments.length === 0) {
|
||||
this._showNativeModalView(<any>frame.topmost().currentPage, undefined, undefined, true);
|
||||
} else {
|
||||
var moduleName: string = arguments[0];
|
||||
var context: any = arguments[1];
|
||||
var closeCallback: Function = arguments[2];
|
||||
var fullscreen: boolean = arguments[3];
|
||||
|
||||
var page = frameCommon.resolvePageFromEntry({ moduleName: moduleName });
|
||||
(<Page>page)._showNativeModalView(this, context, closeCallback, fullscreen);
|
||||
}
|
||||
}
|
||||
|
||||
public closeModal() {
|
||||
|
5
ui/page/page.d.ts
vendored
5
ui/page/page.d.ts
vendored
@ -167,6 +167,11 @@ declare module "ui/page" {
|
||||
*/
|
||||
showModal(moduleName: string, context: any, closeCallback: Function, fullscreen?: boolean);
|
||||
|
||||
/**
|
||||
* Shows the page as a modal view.
|
||||
*/
|
||||
showModal();
|
||||
|
||||
/**
|
||||
* Closes the current modal dialog that this page is showing.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user