basic bookmark support

This commit is contained in:
zadam
2021-10-05 22:08:02 +02:00
parent 0654dc855f
commit 8d42ffca6d
9 changed files with 214 additions and 31 deletions

View File

@@ -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
}
}