added simple showModal() overload

This commit is contained in:
Vladimir Enchev
2015-10-19 10:58:42 +03:00
parent 3e1f8e083e
commit c939e52b06
2 changed files with 17 additions and 3 deletions

View File

@ -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
View File

@ -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.
*/ */