summaryrefslogtreecommitdiff
path: root/loleaflet/js/global.js
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2020-01-07 14:04:14 -0400
committerHenry Castro <hcastro@collabora.com>2020-01-08 18:21:14 +0100
commite9d11f4a6605809d52d4205ec9ff91a6ffef143b (patch)
treef50b61565f0d87eac180c4965cce4e279ea0e073 /loleaflet/js/global.js
parent026500b3a5d60e90e2d34c10fb82ffeef0eeb68c (diff)
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 <hcastro@collabora.com> Tested-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'loleaflet/js/global.js')
-rw-r--r--loleaflet/js/global.js8
1 files changed, 8 insertions, 0 deletions
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';