loleaflet/js/global.js                        |    8 ++++++++
 loleaflet/src/main.js                         |    4 ----
 loleaflet/src/map/handler/Map.TouchGesture.js |    2 +-
 3 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit e9d11f4a6605809d52d4205ec9ff91a6ffef143b
Author:     Henry Castro <[email protected]>
AuthorDate: Tue Jan 7 14:04:14 2020 -0400
Commit:     Henry Castro <[email protected]>
CommitDate: Wed Jan 8 18:21:14 2020 +0100

    loleaflet: simplify "prevent default 'contextmenu' action"
    
    The mobile and desktop prevents default 'contextmenu' action
    
    Change-Id: I89171c955c153b2fceaad92970e2eaf039cb8527
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86373
    Reviewed-by: Henry Castro <[email protected]>
    Tested-by: Henry Castro <[email protected]>

diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js
index b3b619f8c..8445ecb4f 100644
--- a/loleaflet/js/global.js
+++ b/loleaflet/js/global.js
@@ -1,6 +1,14 @@
 /* -*- js-indent-level: 8 -*- */
 (function (global) {
 
+       document.addEventListener('contextmenu', function(e) {
+               if (e.preventDefault) {
+                       e.preventDefault();
+               } else {
+                       e.returnValue = false;
+               }
+       }, false);
+
        global.fakeWebSocketCounter = 0;
        global.FakeWebSocket = function () {
                this.binaryType = 'arraybuffer';
diff --git a/loleaflet/src/main.js b/loleaflet/src/main.js
index fb7890b36..ba500fd09 100644
--- a/loleaflet/src/main.js
+++ b/loleaflet/src/main.js
@@ -91,10 +91,6 @@ window.addEventListener('beforeunload', function () {
        }
 });
 
-if (!L.Browser.mobile) {
-       L.DomEvent.on(document, 'contextmenu', L.DomEvent.preventDefault);
-}
-
 window.bundlejsLoaded = true;
 
 }(window));
diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js 
b/loleaflet/src/map/handler/Map.TouchGesture.js
index 66c333791..f6f22761e 100644
--- a/loleaflet/src/map/handler/Map.TouchGesture.js
+++ b/loleaflet/src/map/handler/Map.TouchGesture.js
@@ -62,7 +62,7 @@ L.Map.TouchGesture = L.Handler.extend({
                        }
 
                        L.DomEvent.on(this._map._mapPane, 'mousedown mousemove 
mouseup', L.DomEvent.preventDefault);
-                       L.DomEvent.on(document, 'contextmenu touchmove', 
L.DomEvent.preventDefault);
+                       L.DomEvent.on(document, 'touchmove', 
L.DomEvent.preventDefault);
                }
 
                for (var events in L.Draggable.MOVE) {
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to