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

Henry Castro hcastro at collabora.com
Sun Jul 1 21:48:36 UTC 2018


 loleaflet/js/toolbar.js |   31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

New commits:
commit 43a7b465bf9f4ace49b0bc88c771a99834826a6d
Author: Henry Castro <hcastro at collabora.com>
Date:   Mon Jun 25 17:28:26 2018 -0400

    lolefalet: mobile mode, hide tooltips
    
    Change-Id: I0bc1f10184f63318c483b590139d570380a47222
    Reviewed-on: https://gerrit.libreoffice.org/56421
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 02e7e204a..3a11ca28d 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -573,6 +573,15 @@ function onColorPick(id, color) {
 	map.focus();
 }
 
+function hideTooltip(toolbar, id) {
+	if (toolbar.touchStarted) {
+		setTimeout(function() {
+			toolbar.tooltipHide(id, {});
+		}, 5000)
+		toolbar.touchStarted = false;
+	}
+}
+
 var stylesSelectValue;
 var fontsSelectValue;
 var fontsizesSelectValue;
@@ -657,6 +666,7 @@ function createToolbar() {
 		],
 		onClick: function (e) {
 			onClick(e, e.target);
+			hideTooltip(this, e.target);
 		},
 		onRefresh: function() {
 			if (map.getDocType() === 'presentation') {
@@ -686,6 +696,9 @@ function createToolbar() {
 		}
 	});
 	toolbar.contextmenu(function() { return false; });
+	toolbar.bind('touchstart', function() {
+		w2ui['toolbar-up'].touchStarted = true;
+	});
 
 	toolbar = $('#formulabar');
 	toolbar.w2toolbar({
@@ -703,6 +716,7 @@ function createToolbar() {
 		],
 		onClick: function (e) {
 			onClick(e, e.target);
+			hideTooltip(this, e.target);
 		},
 		onRefresh: function() {
 			$('#addressInput').off('keyup', onAddressInput).on('keyup', onAddressInput);
@@ -712,6 +726,10 @@ function createToolbar() {
 		}
 	});
 	toolbar.contextmenu(function() { return false; });
+	toolbar.bind('touchstart', function() {
+		w2ui['formulabar'].touchStarted = true;
+	});
+
 	$(w2ui.formulabar.box).find('.w2ui-scroll-left, .w2ui-scroll-right').hide();
 	w2ui.formulabar.on('resize', function(target, e) {
 		e.isCancelled = true;
@@ -730,9 +748,13 @@ function createToolbar() {
 		],
 		onClick: function (e) {
 			onClick(e, e.target);
+			hideTooltip(this, e.target);
 		}
 	});
 	toolbar.contextmenu(function() { return false; });
+	toolbar.bind('touchstart', function() {
+		w2ui['spreadsheet-toolbar'].touchStarted = true;
+	});
 
 	toolbar = $('#presentation-toolbar');
 	toolbar.w2toolbar({
@@ -749,9 +771,13 @@ function createToolbar() {
 		],
 		onClick: function (e) {
 			onClick(e, e.target);
+			hideTooltip(this, e.target);
 		}
 	});
 	toolbar.contextmenu(function() { return false; });
+	toolbar.bind('touchstart', function() {
+		w2ui['presentation-toolbar'].touchStarted = true;
+	});
 
 	toolbar = $('#toolbar-down');
 	toolbar.w2toolbar({
@@ -792,6 +818,7 @@ function createToolbar() {
 			{type: 'button',  id: 'zoomin', img: 'zoomin', hint: _UNO('.uno:ZoomPlus')}
 		],
 		onClick: function (e) {
+			hideTooltip(this, e.target);
 			if (e.item.id === 'userlist') {
 				setTimeout(function() {
 					var cBox = $('#follow-checkbox')[0];
@@ -816,6 +843,10 @@ function createToolbar() {
 			$('#search-input').off('keydown', onSearchKeyDown).on('keydown', onSearchKeyDown);
 		}
 	});
+	toolbar.contextmenu(function() { return false; });
+	toolbar.bind('touchstart', function() {
+		w2ui['toolbar-down'].touchStarted = true;
+	});
 }
 
 var userJoinedPopupMessage = '<div>' + _('%user has joined') + '</div>';


More information about the Libreoffice-commits mailing list