mirror of
https://github.com/uthvah/sync-embeds.git
synced 2026-07-22 06:43:40 +00:00
Add settings toggle for properties button
This commit is contained in:
parent
4128411bb2
commit
5d4616aae9
3 changed files with 20 additions and 6 deletions
|
|
@ -372,12 +372,15 @@ class EmbedManager {
|
|||
|
||||
propertiesEl.classList.add('is-collapsed');
|
||||
|
||||
const toggleBtn = propertiesEl.createDiv('properties-collapse-toggle');
|
||||
toggleBtn.innerHTML = 'â–¶';
|
||||
toggleBtn.onclick = () => {
|
||||
propertiesEl.classList.toggle('is-collapsed');
|
||||
toggleBtn.innerHTML = propertiesEl.classList.contains('is-collapsed') ? 'â–¶' : 'â–¼';
|
||||
};
|
||||
// Only create toggle button if setting is enabled
|
||||
if (this.plugin.settings.showPropertiesToggle) {
|
||||
const toggleBtn = propertiesEl.createDiv('properties-collapse-toggle');
|
||||
toggleBtn.innerHTML = '▶';
|
||||
toggleBtn.onclick = () => {
|
||||
propertiesEl.classList.toggle('is-collapsed');
|
||||
toggleBtn.innerHTML = propertiesEl.classList.contains('is-collapsed') ? '▶' : '▼';
|
||||
};
|
||||
}
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ const DEFAULT_SETTINGS = {
|
|||
showFocusHighlight: true,
|
||||
showHeaderHints: true, // NEW: Header hints (enforcement is always on)
|
||||
hideSectionHeaders: false, // NEW: Hide headers in section embeds
|
||||
showPropertiesToggle: true, // NEW: Show properties collapse toggle button
|
||||
debugMode: false
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -138,6 +138,16 @@ class SyncEmbedsSettingTab extends PluginSettingTab {
|
|||
await this.plugin.saveSettings();
|
||||
}));
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Show properties toggle button')
|
||||
.setDesc('Display a toggle button to collapse/expand properties in embeds')
|
||||
.addToggle(toggle => toggle
|
||||
.setValue(this.plugin.settings.showPropertiesToggle)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.showPropertiesToggle = value;
|
||||
await this.plugin.saveSettings();
|
||||
}));
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Show inline title')
|
||||
.setDesc('Display note title at the top of whole-note embeds (not applicable to section embeds or embeds with aliases)')
|
||||
|
|
|
|||
Loading…
Reference in a new issue