import CollapsibleWidget from "./collapsible_widget.js"; import linkService from "../services/link.js"; class WhatLinksHereWidget extends CollapsibleWidget { getWidgetTitle() { return "What links here"; } getMaxHeight() { return "200px"; } getHelp() { return { title: "This list contains all notes which link to this note through links and relations." }; } getHeaderActions() { const $showFullButton = $("").append("show link map").addClass('widget-header-action'); $showFullButton.on('click', async () => { const linkMapDialog = await import("../dialogs/link_map.js"); linkMapDialog.showDialog(); }); return [$showFullButton]; } async refreshWithNote() { const targetRelations = this.tabContext.note.getTargetRelations(); if (targetRelations.length === 0) { this.$body.text("Nothing links here yet ..."); return; } const $list = $("