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

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Wed May 6 11:05:37 UTC 2020


 loleaflet/src/control/Ruler.js |   24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

New commits:
commit 73a62f189855a2e502fbeff716b6745bbd3f0cbb
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed May 6 09:32:18 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 6 13:05:17 2020 +0200

    ruler: workaround adding a tab-stop on mobile
    
    On mobile, don't show a menu, but add the tab-stop immediately
    when long-press event is sent.
    
    Change-Id: Iedd019a40a891d57467d333239b9cb79317cda2d
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93547
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js
index 7d41d7e66..3c849aaad 100644
--- a/loleaflet/src/control/Ruler.js
+++ b/loleaflet/src/control/Ruler.js
@@ -533,17 +533,21 @@ L.Control.Ruler = L.Control.extend({
 	_onTabstopContainerLongPress: function(event) {
 		var pointX = event.center.x - event.target.getBoundingClientRect().left;
 		this.currentPositionInTwips = this._map._docLayer._pixelsToTwips({x: pointX, y:0}).x;
-
-		$.contextMenu({
-			selector: '.loleaflet-ruler-tabstopcontainer',
-			className: 'loleaflet-font',
-			items: {
-				inserttabstop: {
-					name: _('Insert tabstop'),
-					callback: (this._insertTabstop).bind(this)
+		if (window.mode.isMobile() || window.mode.isTablet()) {
+			this._insertTabstop();
+		}
+		else {
+			$.contextMenu({
+				selector: '.loleaflet-ruler-tabstopcontainer',
+				className: 'loleaflet-font',
+				items: {
+					inserttabstop: {
+						name: _('Insert tabstop'),
+						callback: (this._insertTabstop).bind(this)
+					}
 				}
-			}
-		});
+			});
+		}
 	},
 
 	_insertTabstop: function() {


More information about the Libreoffice-commits mailing list