2025-02-16 13:22:44 +02:00
|
|
|
import type { EventData } from "../../components/app_context.js";
|
2025-02-13 23:23:18 +02:00
|
|
|
import type FNote from "../../entities/fnote.js";
|
|
|
|
|
|
2025-02-15 10:13:47 +02:00
|
|
|
export interface ViewModeArgs {
|
|
|
|
|
$parent: JQuery<HTMLElement>;
|
|
|
|
|
parentNote: FNote;
|
|
|
|
|
noteIds: string[];
|
|
|
|
|
showNotePath?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-13 23:23:18 +02:00
|
|
|
export default abstract class ViewMode {
|
|
|
|
|
|
2025-02-15 10:13:47 +02:00
|
|
|
constructor(args: ViewModeArgs) {
|
2025-02-13 23:46:20 +02:00
|
|
|
// note list must be added to the DOM immediately, otherwise some functionality scripting (canvas) won't work
|
2025-02-15 10:13:47 +02:00
|
|
|
args.$parent.empty();
|
2025-02-13 23:23:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
abstract renderList(): Promise<JQuery<HTMLElement> | undefined>;
|
|
|
|
|
|
2025-02-16 13:22:44 +02:00
|
|
|
entitiesReloadedEvents(e: EventData<"entitiesReloaded">) {
|
|
|
|
|
// Do nothing by default.
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-13 23:23:18 +02:00
|
|
|
}
|