mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 22:05:44 +01:00
added icon to note title row
This commit is contained in:
34
src/public/app/widgets/note_icon.js
Normal file
34
src/public/app/widgets/note_icon.js
Normal file
@@ -0,0 +1,34 @@
|
||||
import TabAwareWidget from "./tab_aware_widget.js";
|
||||
import utils from "../services/utils.js";
|
||||
import protectedSessionHolder from "../services/protected_session_holder.js";
|
||||
import server from "../services/server.js";
|
||||
import SpacedUpdate from "../services/spaced_update.js";
|
||||
|
||||
const TPL = `
|
||||
<div class="note-icon-container">
|
||||
<style>
|
||||
.note-icon-container {
|
||||
padding-top: 3px;
|
||||
padding-left: 7px;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.note-icon-container span {
|
||||
font-size: 200%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<span class="bx bx-archive"></span>
|
||||
</div>`;
|
||||
|
||||
export default class NoteIconWidget extends TabAwareWidget {
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.$icon = this.$widget.find('span');
|
||||
this.contentSized();
|
||||
}
|
||||
|
||||
async refreshWithNote(note) {
|
||||
this.$icon.removeClass().addClass(note.getIcon())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user