[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - loleaflet/src

Aron Budea aron.budea at collabora.com
Wed Oct 25 19:23:54 UTC 2017


 loleaflet/src/map/handler/Map.Scroll.js |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit b7d6fbfb8366810f24c57d8f55ca344549ae1876
Author: Aron Budea <aron.budea at collabora.com>
Date:   Sat Aug 12 16:56:02 2017 +0200

    loleaflet: enable horizontal scrolling via Shift + mousewheel
    
    Change-Id: I3cac65248628042e0150e9f393c89e4fbefb8ed6
    Reviewed-on: https://gerrit.libreoffice.org/41088
    Reviewed-by: pranavk <pranavk at collabora.co.uk>
    Tested-by: pranavk <pranavk at collabora.co.uk>
    (cherry picked from commit 61acc4ae7d604196d7c4ce289355c027326f07ef)
    Reviewed-on: https://gerrit.libreoffice.org/43850
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/loleaflet/src/map/handler/Map.Scroll.js b/loleaflet/src/map/handler/Map.Scroll.js
index f7a98f3c..9c584ecc 100644
--- a/loleaflet/src/map/handler/Map.Scroll.js
+++ b/loleaflet/src/map/handler/Map.Scroll.js
@@ -15,6 +15,7 @@ L.Map.Scroll = L.Handler.extend({
 		}, this);
 
 		this._delta = 0;
+		this._vertical = 1;
 	},
 
 	removeHooks: function () {
@@ -38,6 +39,12 @@ L.Map.Scroll = L.Handler.extend({
 		var left = Math.max(debounce - (+new Date() - this._startTime), 0);
 
 		clearTimeout(this._timer);
+		if (e.shiftKey) {
+			this._vertical = 0;
+		}
+		else {
+			this._vertical = 1;
+		}
 		this._timer = setTimeout(L.bind(this._performScroll, this), left);
 
 		L.DomEvent.stop(e);
@@ -52,7 +59,7 @@ L.Map.Scroll = L.Handler.extend({
 		this._startTime = null;
 
 		if (!delta) { return; }
-		map.fire('scrollby', {x: 0, y: delta * scrollAmount});
+		map.fire('scrollby', {x: (1 - this._vertical) * delta * scrollAmount, y: this._vertical * delta * scrollAmount});
 	}
 });
 


More information about the Libreoffice-commits mailing list