[Libreoffice-commits] online.git: loleaflet/src
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Nov 28 15:39:27 UTC 2018
loleaflet/src/layer/AnnotationManager.js | 13 +++++++++++++
1 file changed, 13 insertions(+)
New commits:
commit c3f2cf88bb25f2743c147a6b844b9a4addd7e9eb
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Wed Nov 7 14:14:46 2018 +0000
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Nov 28 16:36:16 2018 +0100
Avoid synchronous re-layout of comments / red-lines on each modification.
Change-Id: I698c6d47a58cfab2096900e01d19c8f4d4693fc4
(cherry picked from commit c48054f18a1c34d5460a2b9ec74fe57c122ef0a6)
diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js
index 206f7ae71..a410598de 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -472,6 +472,19 @@ L.AnnotationManager = L.Class.extend({
},
+ layout: function (zoom) {
+ if (zoom)
+ this.doLayout(zoom);
+ else if (!this._layoutTimer) {
+ var me = this;
+ me._layoutTimer = setTimeout(function() {
+ delete me._layoutTimer;
+ me.doLayout(zoom);
+ }, 250 /* ms */);
+ } // else - avoid excessive re-layout
+
+ },
+
add: function (comment) {
var annotation = L.annotation(this._map._docLayer._twipsToLatLng(comment.anchorPos.getTopRight()), comment,
comment.id === 'new' ? {noMenu: true} : {}).addTo(this._map);
More information about the Libreoffice-commits
mailing list