Svelte refactoring ok

This commit is contained in:
Simon Cambier
2022-04-16 17:24:04 +02:00
parent 40aba85729
commit 832e782ba8
9 changed files with 300 additions and 230 deletions

View File

@@ -1,25 +1,18 @@
import { Modal } from "obsidian";
import type OmnisearchPlugin from "./main";
import CmpModal from "./CmpModal.svelte";
import { Modal } from 'obsidian'
import type OmnisearchPlugin from './main'
import CmpModal from './CmpModal.svelte'
import { modal } from './stores'
export class OmnisearchModal extends Modal {
constructor(plugin: OmnisearchPlugin) {
super(plugin.app);
this.modalEl.addClass("omnisearch-modal", "prompt");
this.modalEl.replaceChildren(); // Remove all the default Modal's children
super(plugin.app)
this.modalEl.addClass('omnisearch-modal', 'prompt')
this.modalEl.replaceChildren() // Remove all the default Modal's children
modal.set(this)
new CmpModal({
target: this.modalEl,
props: {
modal: this,
plugin,
},
});
}
onOpen(): void {
// this.containerEl.style.border = '1px solid red'
// this.modalEl.style.border = '1px solid blue'
// this.contentEl.style.border = '1px solid green'
})
}
}