From 4b159347dd3c388140854a10aaaed42083d7069a Mon Sep 17 00:00:00 2001 From: Amanda Ghassaei <amandaghassaei@gmail.com> Date: Mon, 26 Oct 2015 19:41:12 -0400 Subject: [PATCH] maintain console input focus --- css/main.css | 4 ++++ js/menus/MenuWrapperView.js | 2 +- js/menus/otherUI/Console.js | 4 +--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/css/main.css b/css/main.css index ef4fa64a..01c226e3 100644 --- a/css/main.css +++ b/css/main.css @@ -592,4 +592,8 @@ label { font-family: Courier, monospace; font-size: 13px; line-height: 25px; +} + +.consoleWarning { + color: orange; } \ No newline at end of file diff --git a/js/menus/MenuWrapperView.js b/js/menus/MenuWrapperView.js index 06f82336..d47124ae 100644 --- a/js/menus/MenuWrapperView.js +++ b/js/menus/MenuWrapperView.js @@ -49,7 +49,7 @@ define(['jquery', 'underscore', 'plist', 'backbone', 'lattice', 'appState', 'tex _onKeyUp: function(e){ if ($(".unresponsiveInput").is(":focus")) return; - if ($("input").is(":focus") && e.keyCode == 13) {//enter key + if ($("#menuWrapper input").is(":focus") && e.keyCode == 13) {//enter key $(e.target).blur(); this._softRenderTab(); return; diff --git a/js/menus/otherUI/Console.js b/js/menus/otherUI/Console.js index 15f14a37..adeba7e1 100644 --- a/js/menus/otherUI/Console.js +++ b/js/menus/otherUI/Console.js @@ -43,7 +43,7 @@ define(['jquery', 'underscore', 'backbone', 'appState'], function($, _, Backbone }, warn: function(string){ - + this._writeOutput("<span class='consoleWarning'>" + string + "</span><br/>"); }, error: function(string){ @@ -72,7 +72,6 @@ define(['jquery', 'underscore', 'backbone', 'appState'], function($, _, Backbone // if (e.keyCode == 38) $output.val(this.model.getPrevHistElem()); // else if (e.keyCode == 40) $output.val(this.model.getNewerHistElem()); if (e.keyCode == 13) this._enterCommand($input); - } else { } }, @@ -81,7 +80,6 @@ define(['jquery', 'underscore', 'backbone', 'appState'], function($, _, Backbone var command = "nice try, this doesn't work yet :)"; $input.val(""); this.write(command); - $input.focus(); } }); -- GitLab