loleaflet/src/control/Control.LokDialog.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
New commits: commit 07f493a89f04bad517c99f8b29952662e9abfe66 Author: Marco Cecchetti <marco.cecche...@collabora.com> AuthorDate: Thu Apr 2 16:20:52 2020 +0200 Commit: Marco Cecchetti <marco.cecche...@collabora.com> CommitDate: Wed Apr 29 13:28:12 2020 +0200 leaflet: calc: move prev next line when input bar is a single line This patch enables the ability to move to the previous or next line by panning when the cell content is more than a single line and the input bar is a not expanded. Change-Id: I5e5035d17dbbc62f9ce83ec86e5037fafc2cac24 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92122 Tested-by: Marco Cecchetti <marco.cecche...@collabora.com> Reviewed-by: Marco Cecchetti <marco.cecche...@collabora.com> diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 7a12317e2..0c76b1d13 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -536,6 +536,21 @@ L.Control.LokDialog = L.Control.extend({ var handles = this._calcInputBar.textSelection.handles; var startHandle = handles.children[0]; var endHandle = handles.children[1]; + var dragEnd = e.type === 'mouseup' || e.type === 'mouseout' || e.type === 'panend'; + + if ((!startHandle || !startHandle.isDragged) && (!endHandle || !endHandle.isDragged) && dragEnd) { + var code = 0; + if (e.deltaX > 30 || e.deltaY > 20) + code = 1025; // ArrowUp + else if (e.deltaX < -30 || e.deltaY < -20) + code = 1024; // ArrowDown + if (code) { + this._map._docLayer.postKeyboardEvent('input', 0, code); + this._map._textInput._emptyArea(); + this._map._docLayer.postKeyboardEvent('up', 0, code); + } + } + if (!endHandle || !startHandle) return; @@ -547,7 +562,6 @@ L.Control.LokDialog = L.Control.extend({ if (!draggedHandle) return; - var dragEnd = e.type === 'mouseup' || e.type === 'mouseout' || e.type === 'panend'; if (dragEnd) draggedHandle.isDragged = false; var mousePos = L.DomEvent.getMousePosition(e.pointers ? e.srcEvent : e, handles); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits