mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-22 16:48:23 +01:00
when the window gets focus, if our mainview is session (and no modals are open), refocus either the cmdinput or the cmd (#562)
This commit is contained in:
parent
6919dbfb5f
commit
73e5515e17
@ -24,6 +24,10 @@ class ModalsModel {
|
||||
})();
|
||||
callback && callback();
|
||||
}
|
||||
|
||||
hasOpenModals(): boolean {
|
||||
return this.store.length > 0;
|
||||
}
|
||||
}
|
||||
|
||||
export { ModalsModel };
|
||||
|
@ -203,6 +203,7 @@ class Model {
|
||||
getApi().onNativeThemeUpdated(this.onNativeThemeUpdated.bind(this));
|
||||
document.addEventListener("keydown", this.docKeyDownHandler.bind(this));
|
||||
document.addEventListener("selectionchange", this.docSelectionChangeHandler.bind(this));
|
||||
window.addEventListener("focus", this.windowFocus.bind(this));
|
||||
setTimeout(() => this.getClientDataLoop(1), 10);
|
||||
this.lineHeightEnv = {
|
||||
// defaults
|
||||
@ -229,6 +230,12 @@ class Model {
|
||||
});
|
||||
}
|
||||
|
||||
windowFocus(): void {
|
||||
if (this.activeMainView.get() == "session" && !this.modalsModel.hasOpenModals()) {
|
||||
this.refocus();
|
||||
}
|
||||
}
|
||||
|
||||
fetchTerminalThemes() {
|
||||
const url = new URL(this.getBaseHostPort() + "/config/terminal-themes");
|
||||
fetch(url, { method: "get", body: null, headers: this.getFetchHeaders() })
|
||||
|
Loading…
Reference in New Issue
Block a user