FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fixed: Unable to show dialog from a modal page by hamorphis · Pull Request #2012 · NativeScript/NativeScript · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ts  (2) .xml  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
10 changes: 10 additions & 0 deletions apps/modal-views-demo/login-page.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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!");
});
}
1 change: 1 addition & 0 deletions apps/modal-views-demo/login-page.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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>
2 changes: 1 addition & 1 deletion ui/dialogs/dialogs.ios.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

Back | FazBrowse Home | New Git URL