[Libreoffice-commits] online.git: loleaflet/Makefile.am loleaflet/src

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Mon Jul 20 20:49:30 UTC 2020


 loleaflet/Makefile.am                        |    1 +
 loleaflet/src/layer/AnnotationManager.js     |    5 ++---
 loleaflet/src/layer/AnnotationManagerBase.js |   13 +++++++++++++
 3 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit 2b313af4f3350794c0bf21c79eba41cd1ed79374
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Jul 18 22:04:28 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Jul 20 22:49:11 2020 +0200

    add AnnotationManagerBase to share code with other modules
    
    Currently AnnotationManager is meant for Writer only, but it makes
    sense to share the code with other modules too. This adds a new
    base class AnnotationManagerBase which will contain the common
    code for the annotation management. Other modules currently have
    the annotations implemented in TileLayer, but this is the first
    step to move them into its own annotation managers too.
    
    Change-Id: I5131337aa95e43ce0844d57e2cc020239af5f100
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99018
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am
index c2dc1f3c4..f6d063a76 100644
--- a/loleaflet/Makefile.am
+++ b/loleaflet/Makefile.am
@@ -320,6 +320,7 @@ LOLEAFLET_JS =\
 	src/dom/PosAnimation.Timer.js \
 	src/map/anim/Map.ZoomAnimation.js \
 	src/map/anim/Map.FlyTo.js \
+	src/layer/AnnotationManagerBase.js \
 	src/layer/AnnotationManager.js \
 	src/control/Control.Scroll.Annotation.js \
 	src/layer/marker/Annotation.js \
diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js
index 59d7ce867..11224fd2a 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -5,7 +5,7 @@
 
 /* global $ */
 
-L.AnnotationManager = L.Class.extend({
+L.AnnotationManager = L.AnnotationManagerBase.extend({
 	options: {
 		marginX: 40,
 		marginY: 10,
@@ -13,8 +13,7 @@ L.AnnotationManager = L.Class.extend({
 		extraSize: L.point(290, 0)
 	},
 
-	initialize: function (map, options) {
-		this._map = map;
+	_initializeSpecific: function (options) {
 		this._items = [];
 		this._hiddenItems = 0;
 		this._selected = null;
diff --git a/loleaflet/src/layer/AnnotationManagerBase.js b/loleaflet/src/layer/AnnotationManagerBase.js
new file mode 100644
index 000000000..b9e0975d5
--- /dev/null
+++ b/loleaflet/src/layer/AnnotationManagerBase.js
@@ -0,0 +1,13 @@
+/* -*- js-indent-level: 8 -*- */
+/*
+ *  L.AnnotationManagerBase
+ */
+
+/* global L */
+
+L.AnnotationManagerBase = L.Class.extend({
+	initialize: function (map, options) {
+		this._map = map;
+		this._initializeSpecific(options);
+	}
+});


More information about the Libreoffice-commits mailing list