File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -278,6 +278,8 @@ export default class MediaDbPlugin extends Plugin {
278278 try {
279279 console . debug ( 'MDB | creating new note' ) ;
280280
281+ options . openNote = this . settings . openNoteInNewTab ;
282+
281283 const fileContent = await this . generateMediaDbNoteContents ( mediaTypeModel , options ) ;
282284
283285 if ( ! options . folder ) {
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export interface MediaDbPluginSettings {
1515 useCustomYamlStringifier : boolean ;
1616 templates : boolean ;
1717 customDateFormat : string ;
18+ openNoteInNewTab : boolean ;
1819
1920 movieTemplate : string ;
2021 seriesTemplate : string ;
@@ -61,6 +62,7 @@ const DEFAULT_SETTINGS: MediaDbPluginSettings = {
6162 useCustomYamlStringifier : true ,
6263 templates : true ,
6364 customDateFormat : 'L' ,
65+ openNoteInNewTab : true ,
6466
6567 movieTemplate : '' ,
6668 seriesTemplate : '' ,
@@ -206,6 +208,16 @@ export class MediaDbSettingTab extends PluginSettingTab {
206208 } ) ;
207209 } ) ;
208210
211+ new Setting ( containerEl )
212+ . setName ( 'Open note in new tab' )
213+ . setDesc ( 'Open the newly created note in a new tab.' )
214+ . addToggle ( cb => {
215+ cb . setValue ( this . plugin . settings . openNoteInNewTab ) . onChange ( data => {
216+ this . plugin . settings . openNoteInNewTab = data ;
217+ this . plugin . saveSettings ( ) ;
218+ } ) ;
219+ } ) ;
220+
209221 containerEl . createEl ( 'h3' , { text : 'New File Location' } ) ;
210222 // region new file location
211223 new Setting ( containerEl )
You can’t perform that action at this time.
0 commit comments