mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
set cssClass and other note related classes on the root widget instead, fixes #1799
This commit is contained in:
@@ -129,27 +129,6 @@ export default class NoteDetailWidget extends TabAwareWidget {
|
||||
|
||||
this.child(typeWidget);
|
||||
}
|
||||
|
||||
this.setupClasses();
|
||||
}
|
||||
|
||||
setupClasses() {
|
||||
for (const clazz of Array.from(this.$widget[0].classList)) { // create copy to safely iterate over while removing classes
|
||||
if (clazz !== 'note-detail' && !clazz.startsWith('hidden-')) {
|
||||
this.$widget.removeClass(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
const note = this.note;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
getTypeWidget() {
|
||||
|
||||
Reference in New Issue
Block a user