mirror of
https://github.com/al0cam/AutoMover.git
synced 2026-07-22 05:41:25 +00:00
28 lines
No EOL
726 B
TypeScript
28 lines
No EOL
726 B
TypeScript
import AutoMoverPlugin from "main";
|
|
import { App, PluginSettingTab, Setting } from "obsidian";
|
|
|
|
export class SettingsTab extends PluginSettingTab{
|
|
plugin: AutoMoverPlugin;
|
|
|
|
constructor(app: App, plugin: AutoMoverPlugin) {
|
|
super(app, plugin);
|
|
this.plugin = plugin;
|
|
}
|
|
|
|
display(): void {
|
|
let { containerEl } = this;
|
|
|
|
containerEl.empty();
|
|
|
|
new Setting(containerEl)
|
|
.setName("Move on open")
|
|
.setDesc("Should the file be moved when it is opened?")
|
|
.addToggle(cb => cb
|
|
.setValue(this.plugin.settings.moveOnOpen)
|
|
.onChange(async (value) => {
|
|
this.plugin.settings.moveOnOpen = value;
|
|
await this.plugin.saveData(this.plugin.settings);
|
|
}));
|
|
}
|
|
|
|
} |