mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user