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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Nov 21 17:22:35 UTC 2018


 loleaflet/js/jquery.mCustomScrollbar.js |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit fbce9a443910ed05c09ddd1830470c6010713944
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Nov 21 16:27:27 2018 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Wed Nov 21 18:22:17 2018 +0100

    Better hack that seems to fix the jumping after touch zoom gestures
    
    Unlike my previous (reverted) attempt, now scrolling using the
    scroll-bar keeps working.
    
    Seldom has coming up with an one-liner been as painful as in this case.
    But that's how 3rd-party JavaScript is, I guess.
    
    Change-Id: I18c26da7b41d7e12dd63763651010641ca2a0069
    Reviewed-on: https://gerrit.libreoffice.org/63718
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    Tested-by: Tor Lillqvist <tml at collabora.com>

diff --git a/loleaflet/js/jquery.mCustomScrollbar.js b/loleaflet/js/jquery.mCustomScrollbar.js
index 38cc715af..fd8b0ed0b 100644
--- a/loleaflet/js/jquery.mCustomScrollbar.js
+++ b/loleaflet/js/jquery.mCustomScrollbar.js
@@ -2014,6 +2014,7 @@ and dependencies (minified).
 		This is where the actual scrolling happens
 		*/
 		_scrollTo=function(el,to,options){
+			// console.log('malihu _scrollTo: options=' + (options==undefined?'UNDEF':JSON.stringify(options)));
 			var d=el.data(pluginPfx),o=d.opt,
 				defaults={
 					trigger:"internal",
@@ -2119,8 +2120,10 @@ and dependencies (minified).
 					}
 				},onUpdate:function(){
 					if(options.callbacks && options.onUpdate){
-						/* callbacks: whileScrolling */
-						if(_cb("whileScrolling")){_mcs(); o.callbacks.whileScrolling.call(el[0]);}
+						if (options.drag) {
+							/* callbacks: whileScrolling */
+							if(_cb("whileScrolling")){_mcs(); o.callbacks.whileScrolling.call(el[0]);}
+						}
 					}
 				},onComplete:function(){
 					if(options.callbacks && options.onComplete){


More information about the Libreoffice-commits mailing list