mirror of
https://github.com/zadam/trilium.git
synced 2025-11-04 13:39:01 +01:00
refactor(views): move full height detection to rendererer
This commit is contained in:
parent
b29c3eff6e
commit
8c56315313
@ -47,7 +47,13 @@ export default class NoteListRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get isFullHeight() {
|
get isFullHeight() {
|
||||||
return this.viewMode?.isFullHeight;
|
switch (this.viewType) {
|
||||||
|
case "list":
|
||||||
|
case "grid":
|
||||||
|
return false;
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async renderList() {
|
async renderList() {
|
||||||
|
|||||||
@ -129,10 +129,6 @@ export default class CalendarView extends ViewMode<{}> {
|
|||||||
args.$parent.append(this.$root);
|
args.$parent.append(this.$root);
|
||||||
}
|
}
|
||||||
|
|
||||||
get isFullHeight(): boolean {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
async renderList(): Promise<JQuery<HTMLElement> | undefined> {
|
async renderList(): Promise<JQuery<HTMLElement> | undefined> {
|
||||||
this.isCalendarRoot = this.parentNote.hasLabel("calendarRoot") || this.parentNote.hasLabel("workspaceCalendarRoot");
|
this.isCalendarRoot = this.parentNote.hasLabel("calendarRoot") || this.parentNote.hasLabel("workspaceCalendarRoot");
|
||||||
const isEditable = !this.isCalendarRoot;
|
const isEditable = !this.isCalendarRoot;
|
||||||
|
|||||||
@ -243,10 +243,6 @@ export default class GeoView extends ViewMode<MapData> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get isFullHeight(): boolean {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#changeState(newState: State) {
|
#changeState(newState: State) {
|
||||||
this._state = newState;
|
this._state = newState;
|
||||||
this.$container.toggleClass("placing-note", newState === State.NewNote);
|
this.$container.toggleClass("placing-note", newState === State.NewNote);
|
||||||
|
|||||||
@ -120,10 +120,6 @@ export default class TableView extends ViewMode<StateInfo> {
|
|||||||
args.$parent.append(this.$root);
|
args.$parent.append(this.$root);
|
||||||
}
|
}
|
||||||
|
|
||||||
get isFullHeight(): boolean {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
async renderList() {
|
async renderList() {
|
||||||
this.$container.empty();
|
this.$container.empty();
|
||||||
this.renderTable(this.$container[0]);
|
this.renderTable(this.$container[0]);
|
||||||
|
|||||||
@ -39,11 +39,6 @@ export default abstract class ViewMode<T extends object> extends Component {
|
|||||||
// Do nothing by default.
|
// Do nothing by default.
|
||||||
}
|
}
|
||||||
|
|
||||||
get isFullHeight() {
|
|
||||||
// Override to change its value.
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
get isReadOnly() {
|
get isReadOnly() {
|
||||||
return this.parentNote.hasLabel("readOnly");
|
return this.parentNote.hasLabel("readOnly");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user