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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 21 12:27:20 UTC 2018


 loleaflet/src/control/Control.Scroll.js |   86 +++++++++++++++-----------------
 1 file changed, 42 insertions(+), 44 deletions(-)

New commits:
commit 132fc22f2b482428237b721ef70dfb89f1e4ceb8
Author:     Aron Budea <aron.budea at collabora.com>
AuthorDate: Fri Sep 21 14:26:14 2018 +0200
Commit:     Aron Budea <aron.budea at collabora.com>
CommitDate: Fri Sep 21 14:27:02 2018 +0200

    Revert "loleaflet: mobile: disable scroll bars"
    
    This reverts commit 4d5fa8f83314ed6969734a57581573cf4d15396d.
    
    Change-Id: I2938818bff98dec862ef3137aca4766dc9d1af20
    Reviewed-on: https://gerrit.libreoffice.org/60872
    Reviewed-by: Aron Budea <aron.budea at collabora.com>
    Tested-by: Aron Budea <aron.budea at collabora.com>

diff --git a/loleaflet/src/control/Control.Scroll.js b/loleaflet/src/control/Control.Scroll.js
index ead1a68a3..56a10a314 100644
--- a/loleaflet/src/control/Control.Scroll.js
+++ b/loleaflet/src/control/Control.Scroll.js
@@ -17,50 +17,48 @@ L.Control.Scroll = L.Control.extend({
 		this._prevDocWidth = 0;
 		this._prevDocHeight = 0;
 
-		if (!L.Browser.mobile) {
-			map.on('scrollto', this._onScrollTo, this);
-			map.on('scrollby', this._onScrollBy, this);
-			map.on('scrollvelocity', this._onScrollVelocity, this);
-			map.on('handleautoscroll', this._onHandleAutoScroll, this);
-			map.on('docsize', this._onUpdateSize, this);
-			map.on('updatescrolloffset', this._onUpdateScrollOffset, this);
-			map.on('updaterowcolumnheaders', this._onUpdateRowColumnHeaders, this);
-
-			var control = this;
-			var autoHideTimeout = null;
-			$('.scroll-container').mCustomScrollbar({
-				axis: 'yx',
-				theme: 'minimal-dark',
-				scrollInertia: 0,
-				advanced:{autoExpandHorizontalScroll: true}, // weird bug, it should be false
-				callbacks:{
-					onScrollStart: function() {
-						control._map.fire('closepopup');
-					},
-					onScroll: function() {
-						control._onScrollEnd(this);
-						if (autoHideTimeout)
-							clearTimeout(autoHideTimeout);
-						autoHideTimeout = setTimeout(function() {
-							//	$('.mCS-autoHide > .mCustomScrollBox ~ .mCSB_scrollTools').css({opacity: 0, 'filter': 'alpha(opacity=0)', '-ms-filter': 'alpha(opacity=0)'});
-							$('.mCS-autoHide > .mCustomScrollBox ~ .mCSB_scrollTools').removeClass('loleaflet-scrollbar-show');
-						}, 2000);
-					},
-					whileScrolling: function() {
-						control._onScroll(this);
-
-						// autoHide feature doesn't work because plugin relies on hovering on scroll container
-						// and we have a mock scroll container whereas the actual user hovering happens only on
-						// real document. Change the CSS rules manually to simulate autoHide feature.
-						$('.mCS-autoHide > .mCustomScrollBox ~ .mCSB_scrollTools').addClass('loleaflet-scrollbar-show');
-					},
-					onUpdate: function() {
-						console.debug('mCustomScrollbar: onUpdate:');
-					},
-					alwaysTriggerOffsets: false
-				}
-			});
-		}
+		map.on('scrollto', this._onScrollTo, this);
+		map.on('scrollby', this._onScrollBy, this);
+		map.on('scrollvelocity', this._onScrollVelocity, this);
+		map.on('handleautoscroll', this._onHandleAutoScroll, this);
+		map.on('docsize', this._onUpdateSize, this);
+		map.on('updatescrolloffset', this._onUpdateScrollOffset, this);
+		map.on('updaterowcolumnheaders', this._onUpdateRowColumnHeaders, this);
+
+		var control = this;
+		var autoHideTimeout = null;
+		$('.scroll-container').mCustomScrollbar({
+			axis: 'yx',
+			theme: 'minimal-dark',
+			scrollInertia: 0,
+			advanced:{autoExpandHorizontalScroll: true}, /* weird bug, it should be false */
+			callbacks:{
+				onScrollStart: function() {
+					control._map.fire('closepopup');
+				},
+				onScroll: function() {
+					control._onScrollEnd(this);
+					if (autoHideTimeout)
+						clearTimeout(autoHideTimeout);
+					autoHideTimeout = setTimeout(function() {
+						//	$('.mCS-autoHide > .mCustomScrollBox ~ .mCSB_scrollTools').css({opacity: 0, 'filter': 'alpha(opacity=0)', '-ms-filter': 'alpha(opacity=0)'});
+						$('.mCS-autoHide > .mCustomScrollBox ~ .mCSB_scrollTools').removeClass('loleaflet-scrollbar-show');
+					}, 2000);
+				},
+				whileScrolling: function() {
+					control._onScroll(this);
+
+					// autoHide feature doesn't work because plugin relies on hovering on scroll container
+					// and we have a mock scroll container whereas the actual user hovering happens only on
+					// real document. Change the CSS rules manually to simulate autoHide feature.
+					$('.mCS-autoHide > .mCustomScrollBox ~ .mCSB_scrollTools').addClass('loleaflet-scrollbar-show');
+				},
+				onUpdate: function() {
+					console.debug('mCustomScrollbar: onUpdate:');
+				},
+				alwaysTriggerOffsets: false
+			}
+		});
 	},
 
 	_onCalcScroll: function (e) {


More information about the Libreoffice-commits mailing list