loleaflet/src/map/handler/Map.TouchGesture.js |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 5d4f845aec0cbe2f4037a3d25cd592007d1604d3
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Fri Aug 16 13:40:03 2019 +0300
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Tue Aug 20 10:54:44 2019 +0200

    tdf#122572: Make the context toolbar show up more reliably
    
    It seems that the _onPress function is sometimes called multiple times
    in succession and then the toolbar got first added but immediately
    removed again. Ugly hack to fix that.
    
    But note that in this branch, copy/paste seems to be broken in the iOS
    app at the moment anyway. Apparently the code that makes it use the
    system pasteboard is missing, or does not get called.
    
    Reviewed-on: https://gerrit.libreoffice.org/77574
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Tor Lillqvist <t...@collabora.com>
    Tested-by: Tor Lillqvist <t...@collabora.com>
    (cherry picked from commit c2956383b9f353ffa98ae4a3c8e21769d3f334db)
    
    Change-Id: Id4f1569670e599a2b37afc9ae5d91f31661f72e2
    Reviewed-on: https://gerrit.libreoffice.org/77789
    Reviewed-by: Tor Lillqvist <t...@collabora.com>
    Tested-by: Tor Lillqvist <t...@collabora.com>

diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js 
b/loleaflet/src/map/handler/Map.TouchGesture.js
index f51da0286..ff5d61d61 100644
--- a/loleaflet/src/map/handler/Map.TouchGesture.js
+++ b/loleaflet/src/map/handler/Map.TouchGesture.js
@@ -21,6 +21,7 @@ L.Map.TouchGesture = L.Handler.extend({
 
                if (window.ThisIsTheiOSApp && !this._toolbar) {
                        this._toolbar = L.control.contextToolbar();
+                       this._toolbarAdded = 0;
                }
 
                if (!this._hammer) {
@@ -157,10 +158,14 @@ L.Map.TouchGesture = L.Handler.extend({
                    mousePos = this._map._docLayer._latLngToTwips(latlng);
 
                if (window.ThisIsTheiOSApp) {
+                       // console.log('==> ' + e.timeStamp);
                        if (!this._toolbar._map && 
this._map._docLayer.containsSelection(latlng)) {
                                this._toolbar._pos = containerPoint;
+                               // console.log('==> Adding context toolbar ' + 
e.timeStamp);
                                this._toolbar.addTo(this._map);
-                       } else {
+                               this._toolbarAdded = e.timeStamp;
+                       } else if (this._toolbarAdded && e.timeStamp - 
this._toolbarAdded >= 1000) {
+                               // console.log('==> Removing context toolbar ' 
+ e.timeStamp);
                                this._toolbar.remove();
                                
this._map._contextMenu._onMouseDown({originalEvent: e.srcEvent});
                                // send right click to trigger context menus
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to