[Libreoffice-commits] online.git: loleaflet/src
Aron Budea
aron.budea at collabora.com
Thu Sep 21 13:46:45 UTC 2017
loleaflet/src/map/handler/Map.Scroll.js | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit 61acc4ae7d604196d7c4ce289355c027326f07ef
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>
diff --git a/loleaflet/src/map/handler/Map.Scroll.js b/loleaflet/src/map/handler/Map.Scroll.js
index 593e1dfb..08722e02 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 () {
@@ -41,7 +42,12 @@ L.Map.Scroll = L.Handler.extend({
if (e.ctrlKey) {
this._timer = setTimeout(L.bind(this._performZoom, this), left);
}
+ else if (e.shiftKey) {
+ this._vertical = 0;
+ this._timer = setTimeout(L.bind(this._performScroll, this), left);
+ }
else {
+ this._vertical = 1;
this._timer = setTimeout(L.bind(this._performScroll, this), left);
}
@@ -57,7 +63,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});
},
_performZoom: function () {
More information about the Libreoffice-commits
mailing list