section widgets are updated lazily

This commit is contained in:
zadam
2021-05-29 14:13:22 +02:00
parent aa901b67ed
commit ef4bc13dd1
2 changed files with 32 additions and 20 deletions

View File

@@ -43,22 +43,6 @@ 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.find(".link-map-container").empty();
const $linkMapContainer = this.$widget.find('.link-map-container');