[Libreoffice-commits] online.git: loleaflet/src
Pranav Kant
pranavk at collabora.co.uk
Mon Apr 24 10:28:26 UTC 2017
loleaflet/src/layer/AnnotationManager.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit c7757a7263258496ad04c98879be841e519be950
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Mon Apr 24 15:56:28 2017 +0530
loleaflet: do not unnecessarily layout on unselect
Return early if there is no annotation selected currently.
Without this patch, we were unnecessarily layouting all the annotations
again and again on every click which is likely to make things slow.
Change-Id: I20ce5894a4d605b9811eb37d3b3af207bbb48d50
diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js
index e3174100..012a6a08 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -177,8 +177,10 @@ L.AnnotationManager = L.Class.extend({
},
unselect: function () {
- this._selected = null;
- this.update();
+ if (this._selected) {
+ this._selected = null;
+ this.update();
+ }
},
select: function (annotation) {
More information about the Libreoffice-commits
mailing list