From e5267db0a4ad8fe490c07ae48fab90bc9692fb14 Mon Sep 17 00:00:00 2001
From: Lloyd Hilaiel <lloyd@hilaiel.com>
Date: Wed, 28 Sep 2011 17:09:25 -0700
Subject: [PATCH] disable button immediately after click for 'verify email'
 button, at least the user gets immeidate visual feedback if the stage_user
 call is slow

---
 .../static/dialog/controllers/authenticate_controller.js     | 2 ++
 browserid/static/dialog/css/popup.css                        | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/browserid/static/dialog/controllers/authenticate_controller.js b/browserid/static/dialog/controllers/authenticate_controller.js
index 2108a9cb5..37000048c 100644
--- a/browserid/static/dialog/controllers/authenticate_controller.js
+++ b/browserid/static/dialog/controllers/authenticate_controller.js
@@ -125,6 +125,8 @@
         return;
       }
 
+      $("button.newuser").attr("disabled", "disabled");
+
       identities.createUser(email, function(keypair) {
         if(keypair) {
           self.close("user_staged", {
diff --git a/browserid/static/dialog/css/popup.css b/browserid/static/dialog/css/popup.css
index 935823440..b6b43bfbe 100644
--- a/browserid/static/dialog/css/popup.css
+++ b/browserid/static/dialog/css/popup.css
@@ -304,6 +304,11 @@ button {
     background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #76C2FF), color-stop(100%, #37A6FF));
 }
 
+button[disabled=disabled] {
+    opacity: .5;
+}
+
+
 button:active {
     background-color: #006EC6;
     border: 1px solid #003E70;
-- 
GitLab