fix rendering

This commit is contained in:
zadam 2021-05-28 23:21:55 +02:00
parent 4b6b8b1678
commit 5e19a37df7

View file

@ -29,6 +29,22 @@ export default class LinkMapWidget extends NoteContextAwareWidget {
}
async refreshWithNote(note) {
let shown = false;
const observer = new IntersectionObserver(entries => {
if (!shown && entries[0].isIntersecting) {
shown = true;
this.displayLinkMap(note);
}
}, {
rootMargin: '0px',
threshold: 0.1
});
observer.observe(this.$widget[0]);
}
async displayLinkMap(note) {
this.$widget.html(TPL);
const $linkMapContainer = this.$widget.find('.link-map-container');