refactor(views): pass argument to constructor

This commit is contained in:
Elian Doran
2025-02-15 10:13:47 +02:00
parent 4592d6750b
commit 68ccd23540
4 changed files with 30 additions and 18 deletions

View File

@@ -1,10 +1,17 @@
import type FNote from "../../entities/fnote.js";
export interface ViewModeArgs {
$parent: JQuery<HTMLElement>;
parentNote: FNote;
noteIds: string[];
showNotePath?: boolean;
}
export default abstract class ViewMode {
constructor($parent: JQuery<HTMLElement>, parentNote: FNote, noteIds: string[], showNotePath: boolean = false) {
constructor(args: ViewModeArgs) {
// note list must be added to the DOM immediately, otherwise some functionality scripting (canvas) won't work
$parent.empty();
args.$parent.empty();
}
abstract renderList(): Promise<JQuery<HTMLElement> | undefined>;