From ea7ee1618b7b92e4223047be203c24e47f450a14 Mon Sep 17 00:00:00 2001
From: Ben Adida <ben@adida.net>
Date: Thu, 14 Jul 2011 10:24:48 -0700
Subject: [PATCH] Added setup of enter key

---
 .../static/dialog/controllers/dialog_controller.js    | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/browserid/static/dialog/controllers/dialog_controller.js b/browserid/static/dialog/controllers/dialog_controller.js
index 2d0d6bfa7..ddb2fcdad 100644
--- a/browserid/static/dialog/controllers/dialog_controller.js
+++ b/browserid/static/dialog/controllers/dialog_controller.js
@@ -12,9 +12,8 @@ $.Controller("Dialog", {}, {
       // keep track of where we are and what we do on success and error
       this.onsuccess = null;
       this.onerror = null;
-
     },
-      
+
     setupEnterKey: function() {
       $("input").keyup(function(e) {
           if(e.which == 13) {
@@ -196,11 +195,15 @@ $.Controller("Dialog", {}, {
     doAuthenticate: function() {
       $('#dialog').html("views/authenticate.ejs", {sitename: this.remoteOrigin});
       $('#bottom-bar').html("views/bottom-signin.ejs", {});
+
+      this.setupEnterKey();
     },
       
     doCreate: function() {
       $('#dialog').html("views/create.ejs", {});
       $('#bottom-bar').html("views/bottom-continue.ejs", {});
+
+      this.setupEnterKey();
       
       var checkedEmails = {};
       var emailCheckState = null;
@@ -283,6 +286,8 @@ $.Controller("Dialog", {}, {
       $('#dialog').html("views/forgotpassword.ejs", {});
       $('#bottom-bar').html("views/bottom-continue.ejs", {});
 
+      this.setupEnterKey();
+
       var self=this;
       function checkInput() {
         var pass = $("#password_input").val();
@@ -315,6 +320,8 @@ $.Controller("Dialog", {}, {
     doNewEmail: function() {
       $('#dialog').html("views/addemail.ejs", {});
       $('#bottom-bar').html("views/bottom-addemail.ejs", {});
+
+      this.setupEnterKey();
     },
 
     doConfirmEmail: function(email, keypair) {
-- 
GitLab