mirror of
https://github.com/zadam/trilium.git
synced 2025-11-16 18:25:51 +01:00
refactor(views): pass argument to constructor
This commit is contained in:
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user