mirror of
https://github.com/zadam/trilium.git
synced 2025-01-16 20:21:43 +08:00
fix css class handling
This commit is contained in:
parent
8e77d729e5
commit
7cac2521ef
4 changed files with 9 additions and 8 deletions
|
@ -445,6 +445,11 @@ class NoteShort {
|
|||
|
||||
return dto;
|
||||
}
|
||||
|
||||
async getCssClass() {
|
||||
const labels = await this.getLabels('cssClass');
|
||||
return labels.map(l => l.value).join(' ');
|
||||
}
|
||||
}
|
||||
|
||||
export default NoteShort;
|
|
@ -134,11 +134,6 @@ async function prepareSearchBranch(note) {
|
|||
return await prepareRealBranch(newNote);
|
||||
}
|
||||
|
||||
async function getCssClass(note) {
|
||||
const labels = await note.getLabels('cssClass');
|
||||
return labels.map(l => l.value).join(' ');
|
||||
}
|
||||
|
||||
async function getExtraClasses(note) {
|
||||
utils.assertArguments(note);
|
||||
|
||||
|
@ -152,7 +147,7 @@ async function getExtraClasses(note) {
|
|||
extraClasses.push("multiple-parents");
|
||||
}
|
||||
|
||||
const cssClass = await getCssClass(note);
|
||||
const cssClass = await note.getCssClass();
|
||||
|
||||
if (cssClass) {
|
||||
extraClasses.push(cssClass);
|
||||
|
|
|
@ -132,7 +132,8 @@ export default class NoteDetailWidget extends TabAwareWidget {
|
|||
const note = this.note;
|
||||
|
||||
if (note) {
|
||||
this.$widget.addClass(note.cssClass);
|
||||
note.getCssClass().then(cssClass => this.$widget.addClass(cssClass));
|
||||
|
||||
this.$widget.addClass(utils.getNoteTypeClass(note.type));
|
||||
this.$widget.addClass(utils.getMimeTypeClass(note.mime));
|
||||
|
||||
|
|
|
@ -596,7 +596,7 @@ export default class TabRowWidget extends BasicWidget {
|
|||
}
|
||||
}
|
||||
|
||||
$tab.addClass(note.cssClass);
|
||||
note.getCssClass().then(cssClass => $tab.addClass(cssClass));
|
||||
$tab.addClass(utils.getNoteTypeClass(note.type));
|
||||
$tab.addClass(utils.getMimeTypeClass(note.mime));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue