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:
parent
8ad6a05000
commit
73a62f1898
1 changed files with 14 additions and 10 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue