[Libreoffice-commits] online.git: 2 commits - loleaflet/src
Henry Castro (via logerrit)
logerrit at kemper.freedesktop.org
Tue Aug 20 14:34:58 UTC 2019
loleaflet/src/control/Control.ContextMenu.js | 7 ++++++-
loleaflet/src/control/Control.LokDialog.js | 9 +++++++++
loleaflet/src/map/handler/Map.TouchGesture.js | 4 ++++
3 files changed, 19 insertions(+), 1 deletion(-)
New commits:
commit b0b11b6e7a036b84e5271fa64c9b7ae8b55a8c93
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Fri Jun 28 13:31:02 2019 -0400
Commit: Henry Castro <hcastro at collabora.com>
CommitDate: Tue Aug 20 16:34:56 2019 +0200
loleaflet: mobile: ensure to close any popups in long press event
Change-Id: I64d438e3667a92f16d5bc39490ba31fdd83691fb
Reviewed-on: https://gerrit.libreoffice.org/77832
Reviewed-by: Henry Castro <hcastro at collabora.com>
Tested-by: Henry Castro <hcastro at collabora.com>
diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js
index e418bfc2a..e5d954f5f 100644
--- a/loleaflet/src/map/handler/Map.TouchGesture.js
+++ b/loleaflet/src/map/handler/Map.TouchGesture.js
@@ -167,6 +167,8 @@ L.Map.TouchGesture = L.Handler.extend({
return;
}
+ this._map.fire('closepopups');
+
if (window.ThisIsTheiOSApp) {
// console.log('==> ' + e.timeStamp);
if (!this._toolbar._map && this._map._docLayer.containsSelection(latlng)) {
commit 4f0c62898cb9ac909a125b81f998bf515769bb5a
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Mon Jun 17 14:30:08 2019 -0400
Commit: Henry Castro <hcastro at collabora.com>
CommitDate: Tue Aug 20 16:34:40 2019 +0200
loeaflet: mobile: close popup dialog on tap event
Change-Id: Iad64295db4d9d135b4ce1f68bb62948e7be8e92e
Reviewed-on: https://gerrit.libreoffice.org/77831
Reviewed-by: Henry Castro <hcastro at collabora.com>
Tested-by: Henry Castro <hcastro at collabora.com>
diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js
index 652971f8f..4d67b67c3 100644
--- a/loleaflet/src/control/Control.ContextMenu.js
+++ b/loleaflet/src/control/Control.ContextMenu.js
@@ -55,12 +55,17 @@ L.Control.ContextMenu = L.Control.extend({
map.on('locontextmenu', this._onContextMenu, this);
map.on('mousedown', this._onMouseDown, this);
map.on('keydown', this._onKeyDown, this);
+ map.on('closepopups', this._onClosePopup, this);
+ },
+
+ _onClosePopup: function () {
+ $.contextMenu('destroy', '.leaflet-layer');
},
_onMouseDown: function(e) {
this._prevMousePos = {x: e.originalEvent.pageX, y: e.originalEvent.pageY};
- $.contextMenu('destroy', '.leaflet-layer');
+ this._onClosePopup();
},
_onKeyDown: function(e) {
diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js
index 391f61490..f655a79c3 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -119,6 +119,7 @@ L.Control.LokDialog = L.Control.extend({
map.on('opendialog', this._openDialog, this);
map.on('docloaded', this._docLoaded, this);
map.on('closepopup', this.onCloseCurrentPopUp, this);
+ map.on('closepopups', this._onClosePopups, this);
map.on('editorgotfocus', this._onEditorGotFocus, this);
L.DomEvent.on(document, 'mouseup', this.onCloseCurrentPopUp, this);
},
@@ -618,6 +619,14 @@ L.Control.LokDialog = L.Control.extend({
removeZoomTarget(this._toStrId(dialogId));
},
+ _onClosePopups: function() {
+ for (var dialog in this._dialogs) {
+ if (this._dialogs[dialog].isSidebar != true) {
+ this._onDialogClose(this._dialogs[dialog].id, true);
+ }
+ }
+ },
+
onCloseCurrentPopUp: function() {
// for title-less dialog only (context menu, pop-up)
if (!this._currentId || !this._isOpen(this._currentId) || this._dialogs[this._currentId].title)
diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js
index 899cd6c2d..e418bfc2a 100644
--- a/loleaflet/src/map/handler/Map.TouchGesture.js
+++ b/loleaflet/src/map/handler/Map.TouchGesture.js
@@ -201,6 +201,8 @@ L.Map.TouchGesture = L.Handler.extend({
if (window.ThisIsTheiOSApp)
this._toolbar.remove();
+
+ this._map.fire('closepopups');
this._map._contextMenu._onMouseDown({originalEvent: e.srcEvent});
this._map._docLayer._postMouseEvent('buttondown', mousePos.x, mousePos.y, 1, 1, 0);
this._map._docLayer._postMouseEvent('buttonup', mousePos.x, mousePos.y, 1, 1, 0);
More information about the Libreoffice-commits
mailing list