From fddca354b33eb2f855178657b775a4008e8da8d5 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 26 Nov 2012 20:52:10 +0000 Subject: [PATCH] proper fix for focus and some styling of the form and allows for pressing enter on form so generally a better fix --- src/static/js/pad.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 34f2a2877..936298abc 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -305,14 +305,22 @@ function handshake() else if(obj.accessStatus == "needPassword") { $("#editorloadingbox").html("You need a password to access this pad
" + - ""+ - ""); + "
"+ + ""); + $("#passwordinput").focus(); + $(".passForm").submit(function(){ + $('.passForm button').click(); + }); } else if(obj.accessStatus == "wrongPassword") { $("#editorloadingbox").html("Your password was wrong
" + - ""+ - ""); + ""+ + ""); + $("#passwordinput").focus(); + $(".passForm").submit(function(){ + $('.passForm button').click(); + }); } }