mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +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();
|
callback && callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hasOpenModals(): boolean {
|
||||||
|
return this.store.length > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { ModalsModel };
|
export { ModalsModel };
|
||||||
|
@ -203,6 +203,7 @@ class Model {
|
|||||||
getApi().onNativeThemeUpdated(this.onNativeThemeUpdated.bind(this));
|
getApi().onNativeThemeUpdated(this.onNativeThemeUpdated.bind(this));
|
||||||
document.addEventListener("keydown", this.docKeyDownHandler.bind(this));
|
document.addEventListener("keydown", this.docKeyDownHandler.bind(this));
|
||||||
document.addEventListener("selectionchange", this.docSelectionChangeHandler.bind(this));
|
document.addEventListener("selectionchange", this.docSelectionChangeHandler.bind(this));
|
||||||
|
window.addEventListener("focus", this.windowFocus.bind(this));
|
||||||
setTimeout(() => this.getClientDataLoop(1), 10);
|
setTimeout(() => this.getClientDataLoop(1), 10);
|
||||||
this.lineHeightEnv = {
|
this.lineHeightEnv = {
|
||||||
// defaults
|
// defaults
|
||||||
@ -229,6 +230,12 @@ class Model {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
windowFocus(): void {
|
||||||
|
if (this.activeMainView.get() == "session" && !this.modalsModel.hasOpenModals()) {
|
||||||
|
this.refocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fetchTerminalThemes() {
|
fetchTerminalThemes() {
|
||||||
const url = new URL(this.getBaseHostPort() + "/config/terminal-themes");
|
const url = new URL(this.getBaseHostPort() + "/config/terminal-themes");
|
||||||
fetch(url, { method: "get", body: null, headers: this.getFetchHeaders() })
|
fetch(url, { method: "get", body: null, headers: this.getFetchHeaders() })
|
||||||
|
Loading…
Reference in New Issue
Block a user