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) }