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@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
This commit is contained in:
Tomaž Vajngerl 2020-05-06 09:32:18 +02:00 committed by Andras Timar
parent 8ad6a05000
commit 73a62f1898

View file

@ -533,7 +533,10 @@ 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;
if (window.mode.isMobile() || window.mode.isTablet()) {
this._insertTabstop();
}
else {
$.contextMenu({
selector: '.loleaflet-ruler-tabstopcontainer',
className: 'loleaflet-font',
@ -544,6 +547,7 @@ L.Control.Ruler = L.Control.extend({
}
}
});
}
},
_insertTabstop: function() {