add some details for collapse

This commit is contained in:
Jiaxin Peng
2023-11-15 00:15:52 +00:00
parent 2b16ea76c6
commit 671936ee41

View File

@@ -50,7 +50,37 @@ export class ObsidianSettingTab extends PluginSettingTab {
containerEl.empty(); containerEl.empty();
containerEl.createEl('h2', { text: i18nConfig.GeneralSetting }) // create a collapsible container
const collapsible = containerEl.createEl('button', {
cls: 'collapsible',
text: i18nConfig.GeneralSetting,
}, (button) => {
button.style.color = "white";
button.style.cursor = "pointer";
button.style.padding = "18px";
button.style.width = "100%";
button.style.border = "none";
button.style.textAlign = "left";
button.style.outline = "none";
button.style.fontSize = "15px";
}
);
const content = containerEl.createDiv('content', (div) => {
div.style.padding = "0 18px";
div.style.display = "none";
div.style.overflow = "hidden";
div.style.backgroundColor = "var(--background-primary-alt)";
}
);
collapsible.appendChild(content);
containerEl.createEl('h2', { text: i18nConfig.GeneralSetting });
new Setting(containerEl) new Setting(containerEl)
.setName(i18nConfig.BannerUrl) .setName(i18nConfig.BannerUrl)