Clean up logs and lets

This commit is contained in:
petoncle 2023-10-29 23:33:46 +01:00
parent 3d5576bb73
commit 6b620276b6
2 changed files with 6 additions and 6 deletions

View file

@ -166,21 +166,21 @@ export function focus() {
commandline_state.clInput.focus() commandline_state.clInput.focus()
commandline_state.clInput.removeEventListener("blur", noblur) commandline_state.clInput.removeEventListener("blur", noblur)
commandline_state.clInput.addEventListener("blur", noblur) commandline_state.clInput.addEventListener("blur", noblur)
logger.debug("commandline_frame focus()") logger.debug("commandline_frame clInput focus()")
Messaging.messageOwnTab("buffered_page_keys", "").then((bufferedPageKeys : string[]) => { Messaging.messageOwnTab("buffered_page_keys", "").then((bufferedPageKeys : string[]) => {
let clInputStillFocused = window.document.activeElement === commandline_state.clInput; const clInputStillFocused = window.document.activeElement === commandline_state.clInput;
logger.debug("buffered_page_keys response received", bufferedPageKeys, logger.debug("buffered_page_keys response received", bufferedPageKeys,
"clInputStillFocused = " + clInputStillFocused) "clInputStillFocused = " + clInputStillFocused)
if (!clInputStillFocused) if (!clInputStillFocused)
return return
if (bufferedPageKeys.length !== 0) { if (bufferedPageKeys.length !== 0) {
const currentClInputValue = commandline_state.clInput.value; const currentClInputValue = commandline_state.clInput.value;
let initialClInputValue = commandline_state.initialClInputValue; const initialClInputValue = commandline_state.initialClInputValue;
logger.debug("Consuming buffered page keys", bufferedPageKeys, logger.debug("Consuming buffered page keys", bufferedPageKeys,
"initialClInputValue = " + initialClInputValue, "initialClInputValue = " + initialClInputValue,
"currentClInputValue = " + currentClInputValue); "currentClInputValue = " + currentClInputValue);
// Native events are assumed to be characters added at the end of clInput. // Native events are assumed to be character keydowns events,
// If the user edits the command (initial clInput value) before the buffered page keys are received, we are out of luck. // i.e. characters appended at the end of clInput.
// Insert page keys just after the command. // Insert page keys just after the command.
commandline_state.clInput.value = commandline_state.clInput.value =
initialClInputValue initialClInputValue

View file

@ -97,7 +97,7 @@ export function hide() {
} }
/** /**
* TODO: Discuss removal of this method? * TODO: Discuss removal of this method. We want clInput to be focused, not cmdline_iframe?
*/ */
export function focus() { export function focus() {
try { try {