import RightDropdownButtonWidget from "./right_dropdown_button.js"; import linkService from "../../services/link.js"; import utils from "../../services/utils.js"; const DROPDOWN_TPL = `
`; export default class BookmarkFolderWidget extends RightDropdownButtonWidget { constructor(note) { super(utils.escapeHtml(note.title), note.getIcon(), DROPDOWN_TPL); this.note = note; } doRender() { super.doRender(); this.$parentNote = this.$dropdownContent.find(".parent-note"); this.$childrenNotes = this.$dropdownContent.find(".children-notes"); } async dropdownShown() { this.$parentNote.empty(); this.$childrenNotes.empty(); const linkOptions = { showTooltip: false, showNoteIcon: true }; this.$parentNote.append((await linkService.createLink(this.note.noteId, linkOptions)).addClass("note-link")); for (const childNote of await this.note.getChildNotes()) { this.$childrenNotes.append($("
  • ").append((await linkService.createLink(childNote.noteId, linkOptions)).addClass("note-link"))); } } refreshIcon() {} }