Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. <div id="loginRegister" class="reveal-modal" data-reveal>
  2.  
  3. <h2>Login :</h2>
  4. {{input placeholder='Email' value=loginEmail}}
  5. {{input placeholder='Password' value=loginPass}}
  6. <button class="tiny small" {{action 'login' loginEmail loginPass}}>Login</button>
  7.  
  8. <a class="close-reveal-modal">&#215;</a>
  9. </div>
  10.  
  11. App.ApplicationView = Ember.View.extend({
  12. // Navbar
  13. didInsertElement: function() {
  14. this.$().foundation('topbar');
  15. this.$().foundation('reveal');
  16. this.$().foundation('reveal-modal');
  17. this.$().foundation('reveal-id');
  18. },
  19. willDestroyElement: function() {
  20. this.$().foundation('topbar', 'off');
  21. this.$().foundation('reveal', 'off');
  22. this.$().foundation('reveal-modal', 'off');
  23. this.$().foundation('reveal-id', 'off');
  24. }
  25. });
  26.  
  27. App.ApplicationController = Ember.Controller.extend({
  28. isLoggedIn: false,
  29.  
  30. init: function() {
  31. var self = this;
  32. self._super();
  33.  
  34. auth = new FirebaseSimpleLogin(appRef, function(error, user) {
  35. if (error) {
  36. console.log(error);
  37. } else if (user) {
  38. self.set('isLoggedIn', true);
  39. } else {
  40. self.set('isLoggedIn', false);
  41. }
  42. });
  43. }
  44. });
  45.  
  46. App.ApplicationRoute = Ember.Route.extend({
  47. actions: {
  48. login: function(email, pass) {
  49. auth.login('password', {
  50. email: email,
  51. password: pass
  52. });
  53. },
  54.  
  55. logout: function() {
  56. auth.logout();
  57. }
  58. }
  59. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement