Permalink
Browse files

Changed usernameError to be a computed property. Fixed bad mixing of …

…static and bound classes
  • Loading branch information...
1 parent a2247ef commit d260ad3e04a284b9d601a7956fd958a69d6599d9 @adam-p adam-p committed Apr 30, 2012
Showing with 3 additions and 5 deletions.
  1. +1 −1 client/app/chat/index.html
  2. +2 −4 client/app/chat/js/app/app.coffee
View
2 client/app/chat/index.html
@@ -57,7 +57,7 @@
<div>
<form>
<fieldset>
- <div class="control-group" {{bindAttr class="usernameError:error"}}>
+ <div {{bindAttr class=":control-group usernameError:error"}}>
<div class="controls">
{{view Ember.TextField class="span3" placeholder="Username" valueBinding="username"}}
</div>
View
6 client/app/chat/js/app/app.coffee
@@ -83,14 +83,12 @@ define ['cs!app/cryptica-datastore-adapter'], ->
templateName: 'login'
username: null
- usernameError: no
+ usernameError: (-> return not @get 'username').property 'username'
submitLogin: (event) ->
event.preventDefault()
- if not @get 'username'
- @set 'usernameError', yes
- return
console.log 'submitLogin clicked'
+ return if @get 'usernameError'
App.routeManager.send 'login', @

0 comments on commit d260ad3

Please sign in to comment.