DebugConsole: don't reset target on toggle()

This commit is contained in:
miruka 2020-04-01 05:41:08 -04:00
parent 4602366b9c
commit 70f67f01ac

View File

@ -73,14 +73,18 @@ HDrawer {
readonly property alias commandsView: commandsView readonly property alias commandsView: commandsView
function toggle(targetItem=mainUI, js="", addToHistory=false) { function toggle(targetItem=null, js="", addToHistory=false) {
if (debugConsole.visible) { if (debugConsole.visible) {
debugConsole.visible = false debugConsole.visible = false
return return
} }
debugConsole.visible = true debugConsole.visible = true
debugConsole.target = targetItem debugConsole.target =
! targetItem && ! debugConsole.target ? mainUI :
targetItem ? targetItem :
debugConsole.target
if (js) debugConsole.runJS(js, addToHistory) if (js) debugConsole.runJS(js, addToHistory)
} }