Resolved #142: Modal views.

This commit is contained in:
Rossen Hristov
2015-05-18 14:05:19 +03:00
parent 3ac52814c7
commit 90722cfc67
17 changed files with 285 additions and 74 deletions

View File

@@ -0,0 +1,32 @@
import observable = require("data/observable");
import pages = require("ui/page");
import textField = require("ui/text-field");
var context: any;
var closeCallback: Function;
var page: pages.Page;
var usernameTextField: textField.TextField;
var passwordTextField: textField.TextField;
export function onShownModally(args: pages.ShownModallyData) {
console.log("login-page.onShownModally, context: " + args.context);
context = args.context;
closeCallback = args.closeCallback;
}
export function onLoaded(args: observable.EventData) {
console.log("login-page.onLoaded");
page = <pages.Page>args.object;
usernameTextField = page.getViewById<textField.TextField>("username");
passwordTextField = page.getViewById<textField.TextField>("password");
}
export function onUnloaded() {
console.log("login-page.onUnloaded");
}
export function onLoginButtonTap() {
console.log("login-page.onLoginButtonTap");
closeCallback(usernameTextField.text, passwordTextField.text);
}