mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-26 22:00:17 +08:00
@ -2,6 +2,7 @@
|
|||||||
import pages = require("ui/page");
|
import pages = require("ui/page");
|
||||||
import textField = require("ui/text-field");
|
import textField = require("ui/text-field");
|
||||||
import frame = require("ui/frame");
|
import frame = require("ui/frame");
|
||||||
|
import dialogs = require("ui/dialogs");
|
||||||
|
|
||||||
var closeCallback: Function;
|
var closeCallback: Function;
|
||||||
|
|
||||||
@ -66,3 +67,12 @@ export function onLoginButtonTap() {
|
|||||||
frame.topmost().goBack();
|
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!");
|
||||||
|
});
|
||||||
|
}
|
@ -12,5 +12,6 @@
|
|||||||
<TextField hint="username" id="username" text="username"/>
|
<TextField hint="username" id="username" text="username"/>
|
||||||
<TextField hint="password" id="password" text="password" secure="true"/>
|
<TextField hint="password" id="password" text="password" secure="true"/>
|
||||||
<Button text="Login" tap="onLoginButtonTap"/>
|
<Button text="Login" tap="onLoginButtonTap"/>
|
||||||
|
<Button text="Show Dialog" tap="onShowDialogButtonTap"/>
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</Page>
|
</Page>
|
@ -388,7 +388,7 @@ export function login(arg: any): Promise<dialogs.LoginResult> {
|
|||||||
function showUIAlertController(alertController: UIAlertController) {
|
function showUIAlertController(alertController: UIAlertController) {
|
||||||
var currentPage = dialogsCommon.getCurrentPage();
|
var currentPage = dialogsCommon.getCurrentPage();
|
||||||
if (currentPage) {
|
if (currentPage) {
|
||||||
var viewController: UIViewController = currentPage.ios;
|
var viewController: UIViewController = currentPage.modal ? currentPage.modal.ios : currentPage.ios;
|
||||||
if (viewController) {
|
if (viewController) {
|
||||||
if (alertController.popoverPresentationController) {
|
if (alertController.popoverPresentationController) {
|
||||||
alertController.popoverPresentationController.sourceView = viewController.view;
|
alertController.popoverPresentationController.sourceView = viewController.view;
|
||||||
|
Reference in New Issue
Block a user