-
-
Save joegaudet/4668064 to your computer and use it in GitHub Desktop.
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
MyApp.MainPage.MainPain: SC.MainPane.create({ | |
didCreateLayer: function(){ | |
SC.Event.add($('#login-name')[0], 'change', this, this.userNameDidChange); | |
SC.Event.add($('#login-passwd')[0], 'change', this, this.passwordDidChange); | |
}, | |
userNameDidChange: function(){ | |
AuthAo.loginController.set('username', $('#login-name').val()); | |
}, | |
passwordDidChange: function(){ | |
AuthAo.loginController.set('password', $('#login-passwd').val()); | |
} | |
}) | |
AuthAo.loginController = SC.Controller.create({ | |
setFieldsWithBrowserDefault: function() { | |
} | |
}); | |
MyApp.LOGGED_OUT = SC.State.extend | |
({ | |
didCompleteCredentialCheck: function(response) { | |
var resp_body = response.get('body'); | |
var lc = AuthAo.loginController; | |
if (SC.ok(response)) { | |
/* Login OK, do some stuff here */ | |
} | |
else { | |
lc.setFieldsWithBrowserDefault(); | |
var loginPane = MyApp.getPath('loginPane'); | |
loginPane.append(); | |
loginPane.focus(); | |
} | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment