mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 13:26:01 +01:00
cssClass label cannot be applied on the root widget because of note splits, fixes #3032
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import FlexContainer from "./flex_container.js";
|
||||
import utils from "../../services/utils.js";
|
||||
import appContext from "../../services/app_context.js";
|
||||
|
||||
export default class RootContainer extends FlexContainer {
|
||||
constructor() {
|
||||
@@ -9,38 +7,4 @@ export default class RootContainer extends FlexContainer {
|
||||
this.id('root-widget');
|
||||
this.css('height', '100%');
|
||||
}
|
||||
|
||||
refresh() {
|
||||
this.$widget.removeClass(); // remove all classes
|
||||
const note = appContext.tabManager.getActiveContextNote();
|
||||
|
||||
if (note) {
|
||||
this.$widget.addClass(note.getCssClass());
|
||||
|
||||
this.$widget.addClass(utils.getNoteTypeClass(note.type));
|
||||
this.$widget.addClass(utils.getMimeTypeClass(note.mime));
|
||||
|
||||
this.$widget.toggleClass("protected", note.isProtected);
|
||||
}
|
||||
}
|
||||
|
||||
noteSwitchedEvent() {
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
activeContextChangedEvent() {
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
noteSwitchedAndActivatedEvent() {
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
entitiesReloadedEvent({loadResults}) {
|
||||
const note = appContext.tabManager.getActiveContextNote();
|
||||
|
||||
if (note && loadResults.isNoteReloaded(note.noteId)) {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user