diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2021-09-08 14:08:28 +0530 |
---|---|---|
committer | Dennis Francis <dennisfrancis.in@gmail.com> | 2021-09-10 14:04:03 +0530 |
commit | ae8d93b60b864e2d798f619dbb93de5c511d339c (patch) | |
tree | 85bd7416d44fbe4f362c0b8d45a53de54695b13e | |
parent | redline comments do not have sectionProperties.data.rectangles (diff) | |
download | online-ae8d93b60b864e2d798f619dbb93de5c511d339c.tar.gz online-ae8d93b60b864e2d798f619dbb93de5c511d339c.zip |
describe why doPendingInitializationInView() is needed
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: Ib483096f1df63662634f1e483a07d5ada4afef66
-rw-r--r-- | loleaflet/src/layer/tile/CommentSection.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/loleaflet/src/layer/tile/CommentSection.ts b/loleaflet/src/layer/tile/CommentSection.ts index f0f8f8f1e8..1a3f131c02 100644 --- a/loleaflet/src/layer/tile/CommentSection.ts +++ b/loleaflet/src/layer/tile/CommentSection.ts @@ -98,7 +98,9 @@ class Comment { this.sectionProperties.isRemoved = false; } - // Do pending initialization if necessary. + // Comments import can be costly if the document has a lot of them. If they are all imported/initialized + // when online gets comments message from core, the initial doc render is delayed. To avoid that we do + // lazy import of each comment when it needs to be shown (based on its coordinates). private doPendingInitializationInView (force: boolean = false) { if (!this.pendingInit) return; |