tdf#122359: Revert e27ae38bebf4b57aa7563357a188e33d0e1e0be8 for non-MOBILEAPP
This will then re-introduce another issue, that the document view
jumps to the caret position when zooming, but that is a less serious
issue.
Change-Id: Iac22f4c2bc753e4311bd6c646c85937ee24b08e5
diff --git a/loleaflet/js/jquery.mCustomScrollbar.js b/loleaflet/js/jquery.mCustomScrollbar.js
index a0d2d32..442b205 100644
--- a/loleaflet/js/jquery.mCustomScrollbar.js
+++ b/loleaflet/js/jquery.mCustomScrollbar.js
@@ -2127,7 +2127,8 @@
// hidden part of the document (for instance when pressing enter on the
// last visible line). The options.timeout==1 is a silly way to detect
// the mouse-wheel scrolling.
if(options.drag || options.timeout===1 || options.calledFromInvalidateCursorMsg==true){
if((window.ThisIsAMobileApp && (options.drag || options.timeout===1 || options.calledFromInvalidateCursorMsg==true)) ||
(!window.ThisIsAMobileApp)) {
/* callbacks: whileScrolling */
if(_cb("whileScrolling")){_mcs(); o.callbacks.whileScrolling.call(el[0]);}
}
diff --git a/loleaflet/src/control/Control.Scroll.js b/loleaflet/src/control/Control.Scroll.js
index 829ce18..e8df36e 100644
--- a/loleaflet/src/control/Control.Scroll.js
+++ b/loleaflet/src/control/Control.Scroll.js
@@ -155,7 +155,11 @@
_onScrollTo: function (e) {
// triggered by the document (e.g. search result out of the viewing area)
$('.scroll-container').mCustomScrollbar('scrollTo', [e.y, e.x], {calledFromInvalidateCursorMsg: e.calledFromInvalidateCursorMsg});
if (window.ThisIsAMobileApp) {
$('.scroll-container').mCustomScrollbar('scrollTo', [e.y, e.x], {calledFromInvalidateCursorMsg: e.calledFromInvalidateCursorMsg});
} else {
$('.scroll-container').mCustomScrollbar('scrollTo', [e.y, e.x]);
}
},
_onScrollBy: function (e) {
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 7c23669..e48f0f1 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1620,7 +1620,11 @@
if (!(this._selectionHandles.start && this._selectionHandles.start.isDragged) &&
!(this._selectionHandles.end && this._selectionHandles.end.isDragged) &&
!(docLayer._followEditor || docLayer._followUser)) {
this._map.fire('scrollto', {x: center.x, y: center.y, calledFromInvalidateCursorMsg: scroll !== undefined});
if (window.ThisIsAMobileApp) {
this._map.fire('scrollto', {x: center.x, y: center.y, calledFromInvalidateCursorMsg: scroll !== undefined});
} else {
this._map.fire('scrollto', {x: center.x, y: center.y});
}
}
}