feat: add option to open new note in a new tab
This commit is contained in:
parent
9ca51ffc59
commit
e7aabb9cb9
2 changed files with 14 additions and 0 deletions
|
|
@ -278,6 +278,8 @@ export default class MediaDbPlugin extends Plugin {
|
|||
try {
|
||||
console.debug('MDB | creating new note');
|
||||
|
||||
options.openNote = this.settings.openNoteInNewTab;
|
||||
|
||||
const fileContent = await this.generateMediaDbNoteContents(mediaTypeModel, options);
|
||||
|
||||
if (!options.folder) {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ export interface MediaDbPluginSettings {
|
|||
useCustomYamlStringifier: boolean;
|
||||
templates: boolean;
|
||||
customDateFormat: string;
|
||||
openNoteInNewTab: boolean;
|
||||
|
||||
movieTemplate: string;
|
||||
seriesTemplate: string;
|
||||
|
|
@ -61,6 +62,7 @@ const DEFAULT_SETTINGS: MediaDbPluginSettings = {
|
|||
useCustomYamlStringifier: true,
|
||||
templates: true,
|
||||
customDateFormat: 'L',
|
||||
openNoteInNewTab: true,
|
||||
|
||||
movieTemplate: '',
|
||||
seriesTemplate: '',
|
||||
|
|
@ -206,6 +208,16 @@ export class MediaDbSettingTab extends PluginSettingTab {
|
|||
});
|
||||
});
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Open note in new tab')
|
||||
.setDesc('Open the newly created note in a new tab.')
|
||||
.addToggle(cb => {
|
||||
cb.setValue(this.plugin.settings.openNoteInNewTab).onChange(data => {
|
||||
this.plugin.settings.openNoteInNewTab = data;
|
||||
this.plugin.saveSettings();
|
||||
});
|
||||
});
|
||||
|
||||
containerEl.createEl('h3', { text: 'New File Location' });
|
||||
// region new file location
|
||||
new Setting(containerEl)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue