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

Marco Cecchetti marco.cecchetti at collabora.com
Tue Feb 2 13:01:34 UTC 2016


 loleaflet/src/control/Control.Zoom.js |    4 ++--
 loleaflet/src/map/Map.js              |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 876a04cb3101e779e01dbbcd127db6ff8a36187d
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Tue Feb 2 13:37:37 2016 +0100

    loleaflet - now only zoomlevelchange trigger _updateDisabled
    
    Earlier both 'zoomend' and 'zoomlevelchange' triggered
    Control.Zoom._updateDisabled.
    
    Removing 'zoomend' let us fire 'zoomlevelchange' when the zoom level
    is set (map.setZoom).
    
    Change-Id: Ifde4977f39ca924bbcb7621d16f6169088d2c608

diff --git a/loleaflet/src/control/Control.Zoom.js b/loleaflet/src/control/Control.Zoom.js
index c3a38d4..837dfaa 100644
--- a/loleaflet/src/control/Control.Zoom.js
+++ b/loleaflet/src/control/Control.Zoom.js
@@ -26,13 +26,13 @@ L.Control.Zoom = L.Control.extend({
 		        zoomName + '-out', container, this._zoomOut);
 
 		this._updateDisabled();
-		map.on('zoomend zoomlevelschange', this._updateDisabled, this);
+		map.on('zoomlevelschange', this._updateDisabled, this);
 
 		return container;
 	},
 
 	onRemove: function (map) {
-		map.off('zoomend zoomlevelschange', this._updateDisabled, this);
+		map.off('zoomlevelschange', this._updateDisabled, this);
 	},
 
 	disable: function () {
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 6549514..c2ec720 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -568,6 +568,7 @@ L.Map = L.Evented.extend({
 
 		if (zoomChanged || afterZoomAnim) {
 			this.fire('zoomend');
+			this.fire('zoomlevelschange');
 		}
 
 		this.fire('moveend', {hard: !preserveMapOffset});


More information about the Libreoffice-commits mailing list