bug 579412 - Focus inputNode on JSTerm when opening the HUD/Console, r=dietrich
authorJulian Viereck <jviereck@mozilla.com>
Fri, 23 Jul 2010 09:51:09 -0300
changeset 48125 b993e9c8edbe8bbb5a567c06c9ca1768673ba778
parent 48124 58101a16aff7d619993819f642b117d940e7303e
child 48126 bcae411bc333534774a1be0cc1be46220f04c718
child 48127 e48845de46aca9dfcb006f4430326dbdba9d5fb5
push id14584
push userrcampbell@mozilla.com
push dateFri, 23 Jul 2010 12:51:40 +0000
treeherdermozilla-central@b993e9c8edbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdietrich
bugs579412
milestone2.0b3pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 579412 - Focus inputNode on JSTerm when opening the HUD/Console, r=dietrich
toolkit/components/console/hudservice/HUDService.jsm
--- a/toolkit/components/console/hudservice/HUDService.jsm
+++ b/toolkit/components/console/hudservice/HUDService.jsm
@@ -1517,16 +1517,17 @@ function HeadsUpDisplay(aConfig)
 
   if (aConfig.consoleOnly) {
     this.HUDBox = aConfig.hudNode;
     this.parentNode = aConfig.hudNode.parentNode;
     this.notificationBox = this.parentNode;
     this.contentWindow = aConfig.contentWindow;
     this.uriSpec = aConfig.contentWindow.location.href;
     this.reattachConsole();
+    this.jsterm.inputNode.focus();
     return;
   }
 
   this.HUDBox = null;
 
   if (aConfig.parentNode) {
     // TODO: need to replace these DOM calls with internal functions
     // that operate on each application's node structure
@@ -1622,16 +1623,17 @@ function HeadsUpDisplay(aConfig)
 
   let console = this.createConsole();
 
   this.contentWindow.wrappedJSObject.console = console;
 
   // create the JSTerm input element
   try {
     this.createConsoleInput(this.contentWindow, this.consoleWrap, this.outputNode);
+    this.jsterm.inputNode.focus();
   }
   catch (ex) {
     Cu.reportError(ex);
   }
 }
 
 HeadsUpDisplay.prototype = {
   /**