Resolved issues #789, #1021, #1031.

This commit is contained in:
Rossen Hristov
2015-11-03 16:12:59 +02:00
parent 0ff96c72fd
commit e7c4209112
12 changed files with 179 additions and 34 deletions

View File

@@ -3,7 +3,6 @@ import pages = require("ui/page");
import textField = require("ui/text-field");
import frame = require("ui/frame");
var context: any;
var closeCallback: Function;
var page: pages.Page;
@@ -11,8 +10,8 @@ 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;
console.log(">>> login-page.onShownModally, context: " + args.context);
closeCallback = args.closeCallback;
var modalPage = <pages.Page>args.object;
@@ -21,18 +20,40 @@ export function onShownModally(args: pages.ShownModallyData) {
}
}
export function onNavigatingTo(args: observable.EventData) {
console.log(">>> login-page.onNavigatingTo");
}
export function onLoaded(args: observable.EventData) {
console.log("login-page.onLoaded");
console.log(">>> login-page.onLoaded");
page = <pages.Page>args.object;
usernameTextField = page.getViewById<textField.TextField>("username");
passwordTextField = page.getViewById<textField.TextField>("password");
}
export function onNavigatedTo(args: pages.NavigatedData) {
console.log(">>> login-page.onNavigatedTo, context: " + args.context);
}
export function onNavigatingFrom(args: observable.EventData) {
console.log(">>> login-page.onNavigatingFrom");
}
export function onNavigatedFrom(args: observable.EventData) {
console.log(">>> login-page.onNavigatedFrom");
}
export function onUnloaded() {
console.log("login-page.onUnloaded");
console.log(">>> login-page.onUnloaded");
}
export function onLoginButtonTap() {
console.log("login-page.onLoginButtonTap");
closeCallback(usernameTextField.text, passwordTextField.text);
console.log(">>> login-page.onLoginButtonTap");
if (closeCallback) {
closeCallback(usernameTextField.text, passwordTextField.text);
}
else {
frame.topmost().goBack();
}
}