mirror of
https://github.com/zadam/trilium.git
synced 2025-11-11 15:55:52 +01:00
basic bookmark support
This commit is contained in:
@@ -1,12 +1,22 @@
|
||||
import ButtonWidget from "./button_widget.js";
|
||||
import appContext from "../../services/app_context.js";
|
||||
|
||||
// TODO: here we could read icon and title of the target note and use it for tooltip and displayed icon
|
||||
import froca from "../../services/froca.js";
|
||||
|
||||
export default class OpenNoteButtonWidget extends ButtonWidget {
|
||||
targetNote(noteId) {
|
||||
froca.getNote(noteId).then(note => {
|
||||
this.icon(note.getIcon());
|
||||
this.title(note.title);
|
||||
|
||||
this.refreshIcon();
|
||||
});
|
||||
|
||||
this.onClick(() => appContext.tabManager.openTabWithNoteWithHoisting(noteId, true));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
initialRenderCompleteEvent() {
|
||||
// we trigger refresh above
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user