mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-02-16 01:41:23 +01:00
cleanup
This commit is contained in:
parent
97595a7718
commit
8afa62fff2
@ -258,25 +258,6 @@ class Model {
|
||||
});
|
||||
}
|
||||
|
||||
updateTermTheme(element: HTMLElement, themeFileName: string, reset: boolean) {
|
||||
const url = new URL(this.getBaseHostPort() + `/config/terminal-themes/${themeFileName}.json`);
|
||||
return fetch(url, { method: "get", body: null, headers: this.getFetchHeaders() })
|
||||
.then((resp) => resp.json())
|
||||
.then((themeVars: TermThemeType) => {
|
||||
Object.keys(themeVars).forEach((key) => {
|
||||
if (reset) {
|
||||
this.resetStyleVar(element, `--term-${key}`);
|
||||
} else {
|
||||
this.resetStyleVar(element, `--term-${key}`);
|
||||
this.setStyleVar(element, `--term-${key}`, themeVars[key]);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(`error applying theme: ${themeFileName}`, error);
|
||||
});
|
||||
}
|
||||
|
||||
getTermThemeJson(themeFileName: string) {
|
||||
const url = new URL(this.getBaseHostPort() + `/config/terminal-themes/${themeFileName}.json`);
|
||||
return fetch(url, { method: "get", body: null, headers: this.getFetchHeaders() })
|
||||
|
@ -53,7 +53,6 @@ type TermWrapOpts = {
|
||||
|
||||
function getThemeFromCSSVars(themeSrcEl: HTMLElement): ITheme {
|
||||
const theme: ITheme = {};
|
||||
console.log("themeSrcEl", themeSrcEl);
|
||||
const tse = themeSrcEl ?? document.documentElement;
|
||||
let rootStyle = getComputedStyle(tse);
|
||||
theme.foreground = rootStyle.getPropertyValue("--term-foreground");
|
||||
|
Loading…
Reference in New Issue
Block a user