loleaflet/src/layer/AnnotationManager.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
New commits: commit dcc3d2a321386a4d11266676d0fc4671e35b7a6f Author: Pranav Kant <pran...@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 (cherry picked from commit c7757a7263258496ad04c98879be841e519be950) Reviewed-on: https://gerrit.libreoffice.org/36885 Reviewed-by: Jan Holesovsky <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.com> 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) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits