diff --git a/browserid/static/dialog/controllers/dialog_controller.js b/browserid/static/dialog/controllers/dialog_controller.js index 748ce889717be2fc72006fd0846f9ee4b26dfcc9..aaa56166b272aadde5cad2ba869ba3069beb22aa 100644 --- a/browserid/static/dialog/controllers/dialog_controller.js +++ b/browserid/static/dialog/controllers/dialog_controller.js @@ -44,13 +44,14 @@ PageController.extend("Dialog", {}, { init: function(el) { - this.element.show(); + var self=this; + //this.element.show(); // keep track of where we are and what we do on success and error - this.onsuccess = null; - this.onerror = null; - var chan = setupChannel(this); - this.stateMachine(); + self.onsuccess = null; + self.onerror = null; + setupChannel(self); + self.stateMachine(); }, getVerifiedEmail: function(origin_url, onsuccess, onerror) { @@ -196,7 +197,6 @@ PageController.extend("Dialog", {}, { doCheckAuth: function() { var self=this; - self.doWait(BrowserID.Wait.checkAuth); BrowserID.Identities.checkAuthenticationAndSync(function onSuccess() {}, function onComplete(authenticated) { if (authenticated) { diff --git a/browserid/static/dialog/controllers/page_controller.js b/browserid/static/dialog/controllers/page_controller.js index 61b9f4d21f0398c125cfb7f93a6a558da8f24a81..724f37e5c240a091d137c9ac2f142a42effc4356 100644 --- a/browserid/static/dialog/controllers/page_controller.js +++ b/browserid/static/dialog/controllers/page_controller.js @@ -72,12 +72,13 @@ }, renderTemplates: function(body, body_vars) { - $("body").removeClass("waiting"); if (body) { var bodyHtml = $.View("//dialog/views/" + body, body_vars); - $("#dialog").html(bodyHtml).hide().fadeIn(ANIMATION_TIME, function() { - $("#dialog input").eq(0).focus(); + var form = $("#formWrap > form"); + form.html(bodyHtml).hide().fadeIn(ANIMATION_TIME, function() { + $("body").removeClass("waiting"); + form.find("input").eq(0).focus(); }); } }, @@ -120,7 +121,7 @@ * two fields, message, description. */ errorDialog: function(info) { - $("#dialog").hide(); + $("form").hide(); $("#error_dialog .title").text(info.message); $("#error_dialog .content").text(info.description); diff --git a/browserid/views/dialog.ejs b/browserid/views/dialog.ejs index 35996046a9b0224c21fc18cd6e28d9e0b757ea6c..9adac52ad887be1a5c3913f2c8369df5e82e6ba3 100644 --- a/browserid/views/dialog.ejs +++ b/browserid/views/dialog.ejs @@ -15,7 +15,7 @@ <link href="https://fonts.googleapis.com/css?family=Droid+Serif:400,400italic,700,700italic" rel="stylesheet" type="text/css"> <title>Browser ID</title> </head> - <body> + <body class="waiting"> <div id="wrapper"> <header id="header" class="cf"> <ul> @@ -24,18 +24,19 @@ </header> <div id="formWrap" class="cf"> - <form novalidate> + <form novalidate class="cf"> - <div id="dialog" class="dialog cf"> + <!-- All of this is going to be replaced on startup, but we need some temporary placeholder --> + <h2>Communicating with server</h2> + <p>Just a moment while we talk with the server.</p> - </div> + </form> - <div id="error_dialog"> - <h3 class="title"></h3> - <p class="content"></p> - </div> + <div id="error_dialog"> + <h3 class="title"></h3> + <p class="content"></p> + </div> - </form> </div> <footer>