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

Pranav Kant pranavk at collabora.co.uk
Tue Jun 13 12:44:11 UTC 2017


 loleaflet/dist/loleaflet.css            |    6 ++++++
 loleaflet/src/control/Control.Scroll.js |    5 +++--
 2 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit b4ff02cacd7bd332f1e3d0074f333dea667c079d
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Tue Jun 13 18:13:00 2017 +0530

    loleaflet: Also show scrollbar on hover
    
    Better to add our own class and then add/remove it instead of messing up
    with original CSS rules.
    
    Change-Id: I45cf2a566d51fe8e7d9b009c4c9d86b97354ffd1

diff --git a/loleaflet/dist/loleaflet.css b/loleaflet/dist/loleaflet.css
index fe69deff..010d8894 100644
--- a/loleaflet/dist/loleaflet.css
+++ b/loleaflet/dist/loleaflet.css
@@ -35,6 +35,12 @@
 	z-index: 1000;
 }
 
+.loleaflet-scrollbar-show {
+    opacity: 1 !important;
+    filter: "alpha(opacity=100)" !important;
+    -ms-filter: "alpha(opacity=100)" !important;
+}
+
 body {
     margin: 0;
 }
diff --git a/loleaflet/src/control/Control.Scroll.js b/loleaflet/src/control/Control.Scroll.js
index 03bdcb77..89affd46 100644
--- a/loleaflet/src/control/Control.Scroll.js
+++ b/loleaflet/src/control/Control.Scroll.js
@@ -37,7 +37,8 @@ L.Control.Scroll = L.Control.extend({
 					if (autoHideTimeout)
 						clearTimeout(autoHideTimeout);
 					autoHideTimeout = setTimeout(function() {
-						$('.mCS-autoHide > .mCustomScrollBox .mCSB_scrollTools, .mCS-autoHide > .mCustomScrollBox ~ .mCSB_scrollTools').css({opacity: 0, 'filter': 'alpha(opacity=0)', '-ms-filter': 'alpha(opacity=0)'});
+						//	$('.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() {
@@ -46,7 +47,7 @@ L.Control.Scroll = L.Control.extend({
 					// 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, .mCS-autoHide > .mCustomScrollBox ~ .mCSB_scrollTools').css({opacity: 1, 'filter': 'alpha(opacity=100)', '-ms-filter': 'alpha(opacity=100)'});
+					$('.mCS-autoHide > .mCustomScrollBox ~ .mCSB_scrollTools').addClass('loleaflet-scrollbar-show');
 				},
 				onUpdate: function() {
 					console.debug('mCustomScrollbar: onUpdate:');


More information about the Libreoffice-commits mailing list