From 70f67f01ac1ceda843fe12e718c8760bcf38b7e9 Mon Sep 17 00:00:00 2001 From: miruka Date: Wed, 1 Apr 2020 05:41:08 -0400 Subject: [PATCH] DebugConsole: don't reset target on toggle() --- src/gui/DebugConsole.qml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/DebugConsole.qml b/src/gui/DebugConsole.qml index 004f4820..74f8d490 100644 --- a/src/gui/DebugConsole.qml +++ b/src/gui/DebugConsole.qml @@ -73,14 +73,18 @@ HDrawer { readonly property alias commandsView: commandsView - function toggle(targetItem=mainUI, js="", addToHistory=false) { + function toggle(targetItem=null, js="", addToHistory=false) { if (debugConsole.visible) { debugConsole.visible = false return } debugConsole.visible = true - debugConsole.target = targetItem + debugConsole.target = + ! targetItem && ! debugConsole.target ? mainUI : + targetItem ? targetItem : + debugConsole.target + if (js) debugConsole.runJS(js, addToHistory) }