From 89f97dd7a416cdfcfcccf1dde4157a85947aaef5 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Wed, 7 Nov 2007 20:44:30 +0000 Subject: [PATCH] Focusing username field on signup and login notes upon loading. --- static/js/Editor.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/static/js/Editor.js b/static/js/Editor.js index 6bf4398..a964176 100644 --- a/static/js/Editor.js +++ b/static/js/Editor.js @@ -179,9 +179,15 @@ Editor.prototype.finish_init = function () { if ( this.init_highlight ) self.highlight(); this.scrape_title(); - if ( this.init_focus ) + if ( this.init_focus ) { this.focus(); + // special-case: focus any username field + var username = withDocument( this.document, function () { return getElement( "username" ); } ); + if ( username ) + username.focus(); + } + signal( self, "init_complete" ); }