Svelte refactoring ok
This commit is contained in:
27
src/modal.ts
27
src/modal.ts
@@ -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'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user