Fixed: Unable to show dialog from a modal page

Resolves #1809
This commit is contained in:
Rossen Hristov
2016-04-22 11:08:36 +03:00
parent 98e8a525a3
commit 8623f4e6d5
3 changed files with 12 additions and 1 deletions

View File

@ -2,6 +2,7 @@
import pages = require("ui/page");
import textField = require("ui/text-field");
import frame = require("ui/frame");
import dialogs = require("ui/dialogs");
var closeCallback: Function;
@ -65,4 +66,13 @@ export function onLoginButtonTap() {
else {
frame.topmost().goBack();
}
}
export function onShowDialogButtonTap() {
console.log(">>> login-page.onShowDialogButtonTap");
dialogs.alert({ title: "test", message: "Anything", okButtonText: "ok" })
.then(function () {
console.log("Dialog closed!");
});
}

View File

@ -12,5 +12,6 @@
<TextField hint="username" id="username" text="username"/>
<TextField hint="password" id="password" text="password" secure="true"/>
<Button text="Login" tap="onLoginButtonTap"/>
<Button text="Show Dialog" tap="onShowDialogButtonTap"/>
</StackLayout>
</Page>

View File

@ -388,7 +388,7 @@ export function login(arg: any): Promise<dialogs.LoginResult> {
function showUIAlertController(alertController: UIAlertController) {
var currentPage = dialogsCommon.getCurrentPage();
if (currentPage) {
var viewController: UIViewController = currentPage.ios;
var viewController: UIViewController = currentPage.modal ? currentPage.modal.ios : currentPage.ios;
if (viewController) {
if (alertController.popoverPresentationController) {
alertController.popoverPresentationController.sourceView = viewController.view;