diff --git a/client/client.coffee b/client/client.coffee index 36f3c8a..037b729 100644 --- a/client/client.coffee +++ b/client/client.coffee @@ -1,6 +1,8 @@ # Homework - Client Side notes = new Meteor.Collection "notes" Deps.autorun -> Meteor.subscribe "my-notes" unless not Meteor.userId() +# Loading (Spinning Cog) +UI.registerHelper "loggingIn", -> Meteor.loggingIn() # User Interface Template.userInfo.events { @@ -67,7 +69,7 @@ pressLogin = (template) -> mail = template.find('#mail').value; pass = template.find('#pass').value Meteor.loginWithPassword mail, pass, (err) -> errCallback err -Template.auth.working = -> Meteor.loggingIn() + Template.auth.events { 'keypress .login': (e,template) -> if e.keyCode is 13 then pressLogin template diff --git a/client/index.html b/client/index.html index f7f8f44..09a922c 100644 --- a/client/index.html +++ b/client/index.html @@ -40,10 +40,8 @@

Register a new Account or login

{{> notifications }} - {{#if working}} -
- -
+ {{#if loggingIn}} + {{> loading}} {{else}} @@ -58,6 +56,7 @@