Skip to content

Commit 5448e8a

Browse files
committed
cafe-townsend: fix enabled on login failed
1 parent 8c7f160 commit 5448e8a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

puremvc-haxe-demo-feathersui-cafe-townsend/src/org/puremvc/haxe/demos/feathersui/cafetownsend/view/EmployeeLoginMediator.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ class EmployeeLoginMediator extends Mediator implements IMediator {
9393
} else {
9494
// if the auth info was incorrect, prompt with an alert box and remain on the login screen
9595
Alert.show("Invaild username and/or password. Please try again.", "Login Failed", ["OK"]);
96+
employeeLogin.resetLogin(false);
9697
}
9798
}
9899

puremvc-haxe-demo-feathersui-cafe-townsend/src/org/puremvc/haxe/demos/feathersui/cafetownsend/view/components/EmployeeLogin.hx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,14 @@ class EmployeeLogin extends ScrollContainer {
3838
super();
3939
}
4040

41-
public function resetLogin():Void {
41+
public function resetLogin(clear:Bool = true):Void {
4242
username.enabled = true;
4343
password.enabled = true;
44-
username.text = "";
45-
password.text = "";
44+
login_btn.enabled = true;
45+
if (clear) {
46+
username.text = "";
47+
password.text = "";
48+
}
4649
}
4750

4851
override private function initialize():Void {
@@ -101,6 +104,7 @@ class EmployeeLogin extends ScrollContainer {
101104

102105
username.enabled = false;
103106
password.enabled = false;
107+
login_btn.enabled = false;
104108

105109
// if everything validates, broadcast an event
106110
dispatchEvent(new Event(APP_LOGIN));

0 commit comments

Comments
 (0)