Almost there...

This commit is contained in:
Simon Cambier
2022-04-18 22:42:30 +02:00
parent f6c3f9b580
commit dc32bcad5b
6 changed files with 51 additions and 13 deletions

View File

@@ -1,11 +1,11 @@
import { Modal, TFile } from 'obsidian'
import type OmnisearchPlugin from './main'
import CmpModalVault from './CmpModalVault.svelte'
import CmpModalFile from './CmpModalFile.svelte'
import CmpModalInFile from './CmpModalInFile.svelte'
import { inFileSearch, modal } from './stores'
export class OmnisearchModal extends Modal {
constructor(plugin: OmnisearchPlugin, file?: TFile) {
constructor(plugin: OmnisearchPlugin, file?: TFile, canGoBack = false) {
super(plugin.app)
// Remove all the default modal's children (except the close button)
@@ -19,8 +19,11 @@ export class OmnisearchModal extends Modal {
modal.set(this)
if (file) {
new CmpModalFile({
new CmpModalInFile({
target: this.modalEl,
props: {
canGoBack,
},
})
}
else {