From f1565ca5cea1599076fe173c302099ebd3680993 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 16 Dec 2008 11:30:28 -0500 Subject: [PATCH] Hopefully fix quirks in last commit --- common/content/modes.js | 15 ++++++++------- common/content/ui.js | 6 ++---- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/common/content/modes.js b/common/content/modes.js index 203d6198..20b576da 100644 --- a/common/content/modes.js +++ b/common/content/modes.js @@ -72,7 +72,7 @@ const modes = (function () //{{{ // Usually you should only indicate to leave a special mode like HINTS // by calling modes.reset() and adding the stuff which is needed // for its cleanup here - function handleModeChange(oldMode, newMode) + function handleModeChange(oldMode, newMode, oldExtended) { switch (oldMode) @@ -102,7 +102,7 @@ const modes = (function () //{{{ case modes.COMMAND_LINE: // clean up for HINT mode - if (modes.extended & modes.HINTS) + if (oldExtended & modes.HINTS) hints.hide(); commandline.close(); break; @@ -173,18 +173,19 @@ const modes = (function () //{{{ set: function (mainMode, extendedMode, silent) { silent = (silent || main == mainMode && extended == extendedMode); + if (typeof extendedMode === "number") + extended = extendedMode; // if a main mode is set, the extended is always cleared if (typeof mainMode === "number") { - if (mainMode != main) - handleModeChange(main, mainMode); - + let oldMain = main, oldExtended = extended; main = mainMode; if (!extendedMode) extended = modes.NONE; + + if (main != oldMain) + handleModeChange(oldMain, mainMode, oldExtended); } - if (typeof extendedMode === "number") - extended = extendedMode; if (!silent) this.show(); diff --git a/common/content/ui.js b/common/content/ui.js index 960045cc..a2420b91 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -947,10 +947,8 @@ function CommandLine() //{{{ } if (!outputContainer.collapsed) { - setTimeout(function () { - modes.set(modes.COMMAND_LINE, modes.OUTPUT_MULTILINE); - commandline.updateMorePrompt(); - }, 0); + modes.set(modes.COMMAND_LINE, modes.OUTPUT_MULTILINE); + commandline.updateMorePrompt(); } keepCommand = false; },