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

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Wed Nov 20 15:12:42 UTC 2019


 loleaflet/src/control/Control.js |   18 +-----------------
 loleaflet/src/map/Map.js         |    1 -
 2 files changed, 1 insertion(+), 18 deletions(-)

New commits:
commit 4358d2a04ec5465d55e336aa826788c17df96d71
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Wed Nov 20 10:41:16 2019 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Wed Nov 20 16:12:24 2019 +0100

    loleaflet: remove the function removeControls
    
    There is no toolbarContainer element anymore, it is better
    to remove dead code.
    
    Change-Id: Iac401698ee06223c5af3a69ac18f4bdc8f8c71b4
    Reviewed-on: https://gerrit.libreoffice.org/83321
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Tested-by: Henry Castro <hcastro at collabora.com>

diff --git a/loleaflet/src/control/Control.js b/loleaflet/src/control/Control.js
index 271072e38..db8e4c7ca 100644
--- a/loleaflet/src/control/Control.js
+++ b/loleaflet/src/control/Control.js
@@ -95,16 +95,8 @@ L.control = function (options) {
 L.Map.include({
 	addControl: function (control) {
 		control._map = this;
-		var controlDiv = control.onAdd(this);
-		var controlContainer = L.DomUtil.get(this.options.toolbarContainer);
-		if (!this._controls) {
-			this._controls = [];
-		}
+		control.onAdd(this);
 
-		if (controlContainer && controlDiv) {
-			controlContainer.appendChild(controlDiv);
-			this._controls.push({div: controlDiv});
-		}
 		return this;
 	},
 
@@ -113,14 +105,6 @@ L.Map.include({
 		return this;
 	},
 
-	removeControls: function () {
-		if (this._controls) {
-			this._controls.forEach(function (control) {
-				L.DomUtil.remove(control.div);
-			});
-		}
-	},
-
 	_initControlPos: function () {
 		var corners = this._controlCorners = {},
 		    l = 'leaflet-',
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index ca6843ee8..0852fa0ef 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -671,7 +671,6 @@ L.Map = L.Evented.extend({
 		if (this._docLayer) {
 			this.removeLayer(this._docLayer);
 		}
-		this.removeControls();
 		this._socket.close();
 		return this;
 	},


More information about the Libreoffice-commits mailing list