mirror of
https://github.com/zadam/trilium.git
synced 2025-02-22 22:13:07 +08:00
fix rendering
This commit is contained in:
parent
4b6b8b1678
commit
5e19a37df7
1 changed files with 16 additions and 0 deletions
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue