mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +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;
|
this._navigationContext = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
public showModal(moduleName: string, context: any, closeCallback: Function, fullscreen?: boolean) {
|
public showModal() {
|
||||||
var page = frameCommon.resolvePageFromEntry({ moduleName: moduleName });
|
if (arguments.length === 0) {
|
||||||
(<Page>page)._showNativeModalView(this, context, closeCallback, fullscreen);
|
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() {
|
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);
|
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.
|
* Closes the current modal dialog that this page is showing.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user