import RightDropdownButtonWidget from "./right_dropdown_button.js"; import linkService from "../../services/link.js"; const DROPDOWN_TPL = `
`; export default class BookmarkFolderWidget extends RightDropdownButtonWidget { constructor(note) { super(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.createNoteLink(this.note.noteId, linkOptions)) .addClass("note-link") ); for (const childNote of await this.note.getChildNotes()) { this.$childrenNotes.append( $("